$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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