28 Jul
2011
28 Jul
'11
8:19 a.m.
On 7/27/2011 3:35 PM, Igor R wrote:
My compiler crashes when I write:
bind(&S::bar,&s1);
is there some known issue with VS8?
Yes, VC8 crashes on incorrect bind expressions. You probably missed some placeholder.
Thanks. Can someone tell me what's wrong? I thought I followed the example from the manual. void foo (int); class S { const char* const name; public: S(const char* x) : name(x) {} void bar (int); }; S s1 ("s1"); // some instance void subscribe (State_t st, const NotifyFunc& func); subscribe (STATE1, &foo); // this works, so the form of the function parameters is right. subscribe (STATE1, bind(&S::bar, &s1)); // this one is wrong. Why?