I have a class:
//header file
class CMDatabase
{
class Try;
typedef boost::shared_ptr TryPtr;
typedef boost::ptr_vector TryVect
Just for sake of completeness, the following statement is wrong! Thanks to Matthieu M. to point out my mistake!
On dereferencing an iterator of the boost pointer container you will get the pure pointer to the element. So you can try to dereference the pure pointer you get through the iterator:
CMDatabase::TryVectorIterator it =
find_if(updateTry.begin(), updateTry.end(), bind1st(mem_fun(&CMDatabase::Try::equal), **i));
Where the following is still correct ;)
Or you can use the the operator[] implementation of the boost::ptr_vector which will return a reference to the element:
for (std::size_t i = 0, l = ; defaultTry.size(); ++i) {
CMDatabase::TryVectorIterator it = std::find_if(
updateTry.begin(),
updateTry.end(),
std::bind1st(std::mem_fun(&CMDatabase::Try::equal), defaultTry[i])
);
}
Hope this helps.