By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,919 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,919 IT Pros & Developers. It's quick & easy.

boost::signal doesn't wotk when compiled with /clr?

P: n/a
Could someone explain why the following code works when compiled
without /clr but fails at runtime with a boost::bad_function_call
exception when compiled with /clr?

#include <iostream>
using std::cout;
using std::endl;
#include <boost/signal.hpp>
#include <functional>

struct EventReceiver
{
public:
void funct(int a)
{
cout<<"In funct"<<endl;
}
};

int main()
{
boost::signal<void (int)> event;
EventReceiver receiver;
boost::signals::connection
con=event.connect(std::bind1st(std::mem_fun(EventR eceiver::funct),
&receiver)); //(1)
event(3);
con.disconnect();
return 0;
}

(1) : I've tried other solutions for the binding : using boost::bind,
using an hand-written binary function, etc..., but to no avail.

Thanks.

Arnaud
MVP - VC
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.