lambda and smart pointers
8 Sep
2003
8 Sep
'03
noon
What's the proper way to use lambda with smart pointers? I'm trying to compile the following: class Dados { public: Dados(int _a) : a(_a) {}; int Pega() const { return a; } private: int a; }; int main() { shared_ptr<Dados> pDados(new Dados(5)); cout << (bind(&Dados::Pega, _1)(pDados)==5) << endl; return 0; } I've already tried with *_1 with no success. In this case, the compiler (VC7.1) returns "error C2039: 'iterator_category' : is not a member of 'boost::shared_ptr<T>'". Any hope? Thanks, rod
7752
Age (days ago)
7752
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rodolfo Lima