I'm trying to access a member function of a nested class in a find_if expression.
My code below causes a compile error in the bind expression - (‘COuter::innerClass’ is not a class or namespace).
Could you help me with the correct bind expression?
vector<COuter> vec; vec.push_back(COuter()); vector<COuter>::const_iterator it = find_if(vec.begin(), vec.end(), bind(&COuter::innerClass::GetTemp, _1) == 42); My example classes:
class CInner { public: CInner() : _temp(42) {}; int GetTemp() const { return _temp; } private: int _temp; }; class COuter { public: CInner innerClass; };