Boost lambda with std::find_if does not compile

195 views Asked by At

Consider this template member method of some class:

template<typename T>
bool elementIsInSharedPtrVector(const T& p_elem, const std::vector< boost::shared_ptr< T > >& p_Vector) const
{
    return (std::find_if(p_Vector.begin(), p_Vector.end(), **boost::lambda::_1 == p_elem) != p_Vector.end());
}

The compiler gives this error(besides hundreds of template errors):

usr/include/boost/pointee.hpp:30: error: no type named 'element_type' in 'struct SLnAdjW'

The type SLnAdjW is a POD C struct with a free defined == operator function.

What I'm doing wrong here?

0

There are 0 answers