|
Boost Users : |
Subject: Re: [Boost-users] [boost-users]Shared_ptr and std::find
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2009-08-07 09:14:17
Frank Mori Hess wrote:
> On Thursday 06 August 2009, Ryan McConnehey wrote:
>> Is it possible to have std::find compare the class that the shared_ptr
>> is pointing too?
>
> It would probably be easier to use std::find_if()
>
Or see:
http://www.boost.org/doc/libs/1_39_0/libs/iterator/doc/indirect_iterator.html
MyContOfPtrs::iterator itr =
std::find( make_indirect_iterator(myContOfPtrs.begin())
, make_indirect_iterator(myContOfPtrs. end())
, AnInstance).base();
note call .base() on the return value from std::find to get the original
iterator.
Jeff
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net