Re: [Boost-bugs] [Boost C++ Libraries] #5991: find_ptr (find wrapper)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5991: find_ptr (find wrapper)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-04 09:25:40


#5991: find_ptr (find wrapper)
-------------------------------------------------------+--------------------
  Reporter: Olaf van der Spek <olafvdspek@…> | Owner: joaquin
      Type: Feature Requests | Status: closed
 Milestone: To Be Determined | Component: multi_index
   Version: Boost 1.47.0 | Severity: Problem
Resolution: wontfix | Keywords:
-------------------------------------------------------+--------------------

Comment (by Olaf van der Spek <olafvdspek@…>):

 Replying to [comment:9 joaquin]:
> Of course, but it has find(), which I understand you're copying
 semantics from, except that you return a pointer (null if no element was
 found) rather than an iterator (pointing to end if no element was found.)

 True. Ideally I'd like to have find_ptr() for all containers that have a
 find().

> >
> > > > IMO the wrapper is useful every time you use a map like container.
> > >
> > > In either case, find_ptr can be provided as an (overloaded)
 function, no need to have as a built-in member function. Thus my
 reluctance to address your request.
> >
> > Can it? I can't (easily) select another overload for containers (like
 multi_index) that don't have a pair value_type.
>
> multi_index_containers don't sport a notion of second_type.

 Right

> But you can use the same wrapper as you're currently doing with
 std::set. Remember this conversarion began with your request for a member
 function returning a value_type* (not a pointer to the second part of the
 value.)

 I don't have one yet.

> What problems are you having with defining an overload for
 multi_index_containers?

 I could easily define one with a different name, but I've no idea what
 enable_if code to use for automatic overload selection.

> Not strictly necessary: if you don't specify the index it's as if you're
 using the first one.

 True, but now the code assumes from is the first index.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5991#comment:11>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC