Re: [Boost-users] Compiler Error With boost::bind and boost::signals
I forgot: I am using the Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86 and Boost Version 1.35. KERSAM wrote:
Hello.
I have a compiler error when I try to use boost::bind and boost::signals. Here is the code:
-------------------- #include
#include class MyBoostTest { public: void testFunction(int x, int y) {} };
void doConnect() { boost::signal2
signal; signal.connect(boost::bind<void>(&MyBoostTest::testFunction, new MyBoostTest, _1)); } ----------------------------------- The compiler gives me the following error: c:\3rdparty\boost\boost\bind.hpp(289) : error C2064: term does not evaluate to a function taking 2 arguments class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
What am I doing wrong?
Regards
-- View this message in context: http://www.nabble.com/Compiler-Error-With-boost%3A%3Abind-and-boost%3A%3Asig... Sent from the Boost - Users mailing list archive at Nabble.com.
AMDG KERSAM wrote:
class MyBoostTest { public: void testFunction(int x, int y) {} };
signal.connect(boost::bind<void>(&MyBoostTest::testFunction, new MyBoostTest, _1));
What am I doing wrong?
testFunction needs three arguments, the class instance, x, and y. add _2 to the parameters for boost::bind. In Christ, Steven Watanabe
No, that's not working.... I still got the same error. Any other ideas? Steven Watanabe-4 wrote:
AMDG
KERSAM wrote:
class MyBoostTest { public: void testFunction(int x, int y) {} };
signal.connect(boost::bind<void>(&MyBoostTest::testFunction, new MyBoostTest, _1));
What am I doing wrong?
testFunction needs three arguments, the class instance, x, and y. add _2 to the parameters for boost::bind.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/Compiler-Error-With-boost%3A%3Abind-and-boost%3A%3Asig... Sent from the Boost - Users mailing list archive at Nabble.com.
On Mon, Feb 2, 2009 at 12:05 PM, KERSAM
No, that's not working.... I still got the same error. Any other ideas?
I'm using Boost 1.35.0 and Visual Studio 2003 and Steve's suggestion
worked fine. There was a remaining benign warning C4675 about argument
dependent lookup.
Here's the code that compiled:
#include
participants (3)
-
KERSAM
-
Peter Barker
-
Steven Watanabe