On Thu, Jul 28, 2011 at 9:19 AM, John M. Dlugosz <mpbecey7gu@snkmail.com> wrote:
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?
Does
subscribe (STATE1, bind(&S::bar, s1));
work?