29 Aug 17:04
1.34.1: boost bind issue with function template
From: mbrodeur65 <martin.brodeur <at> adacelcanada.com>
Subject: 1.34.1: boost bind issue with function template
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-08-29 15:05:22 GMT
Subject: 1.34.1: boost bind issue with function template
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-08-29 15:05:22 GMT
Hi,
I'm having problem compiling this piece of code in VC++ 7.1. I don't know if
it is a bug in this environment but it compiles properly under gcc 3.4.4.
thanks for any help !!!
#include <boost/signal.hpp>
#include <boost/bind.hpp>
boost::signal<void (int)> m_signal;
struct Foo
{
void test(int x) {}
};
template <typename C>
boost::signals::connection Subscribe(C* ptr,void (C::*callback)(int))
{
return m_signal.connect(boost::bind(callback,ptr,_1));
}
int main()
{
Foo f;
Subscribe(&f, &Foo::test);
return 0;
}
(Continue reading)
RSS Feed