I've just started working on my first project trying to fully utilize
STL and the boost libraries, and have already run into something that
I can't seem to figure out...
I'm trying to use find_if to check if a member function of an object
contained in an array returns true. It will only return true for a
single object in the collection, so I just need the first instance.
When the vector is declared like this:
vector col;
This statement compiles...
vector::const_iterator i =
find_if(col.begin(),col.end(),mem_fun(&Widget::IsPrimary));
However, when I try to use the boost::shared_ptr library like so...
typedef boost::shared_ptr<Widget> WidgetPtr;
vector<WidgetPtr> col;
This statement causes gcc to bark with all manner of errors...
vector<WidgetPtr>::const_iterator i =
find_if(col.begin(),col.end(),mem_fun(&Widget::IsPrimary));
I'm thinking I've missed something basic, but it's eluding me...