473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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
0 990

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: SnaiL | last post by:
I've try to compile simple program which uses boost::program_options and got error like this: LINK : fatal error LNK1104: cannot open file 'libboost_program_options-vc7-mt-s-1_32.lib' I was...
16
by: Jeff Flinn | last post by:
At the risk of raising the OT ire of some here, I'd like to know what might be done to raise the awareness of the boost libraries. I've found boost and it's libraries invaluable in my work for ~5...
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
1
by: alex.gman | last post by:
As I understand, Loki has only been partially copied into BOOST. Which parts haven't, and why? Were those considered poorly designed? :-)
0
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some...
9
by: atomik.fungus | last post by:
g++ wont let me compile boost signals, not even the example that comes in the documentation. I have the libboost_signals.a binary but im not sure if im using it correctly. Here is the code ...
3
by: Memfis | last post by:
What is the best practice for using boost::signal? Should the signal be a public field? Should an accessor method be used? Should there be some special connection methods for every signal, like the...
7
by: myfavdepo | last post by:
Hi all, I have a query regarding the exchanging of a boost::shared_ptr beween different threads. In my program i've two threads both of which having their own internal queues for storing the...
9
by: Chelong | last post by:
Hi All I am using the srand function generate random numbers.Here is the problem. for example: #include<iostream> #include <time.h> int main() {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.