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
#include
boost::signal 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;
}
Here are the compiler errors:
c:\Program Files\boost\boost_1_34_1\boost\visit_each.hpp(25) : warning
C4675: 'void
boost::_bi::visit_each,boost::_bi::list2::B1,A2>>(V &,const boost::_bi::bind_t &,int)' : resolved
overload was found by argument-dependent lookup
with
[
Visitor=boost::signals::detail::bound_objects_visitor,
R=void,
T=Foo,
A1=int,
C=Foo,
A2=boost::arg<1>,
V=boost::signals::detail::bound_objects_visitor,
F=boost::_mfi::mf1,
L=boost::_bi::list2>::B1,boost::_bi::list_av_2>::B2>
]
c:\Program Files\boost\boost_1_34_1\boost\bind.hpp(1173) : see
declaration of 'boost::_bi::visit_each'
c:\Program Files\boost\boost_1_34_1\boost\signals\slot.hpp(123) :
see reference to function template instantiation 'void
boost::visit_eachboost::signals::detail::bound_objects_visitor,F(Visitor
&,const T &)' being compiled
with
[
F=boost::_bi::bind_t,boost::_bi::list2>::B1,boost::_bi::list_av_2>::B2>>,
Visitor=boost::signals::detail::bound_objects_visitor,
T=boost::_bi::bind_t,boost::_bi::list2>::B1,boost::_bi::list_av_2>::B2>>
]
c:\Documents and Settings\mbrodeur\My Documents\Visual Studio
Projects\testboost\testboost\testboost.cpp(16) : see reference to function
template instantiation
'boost::slot<SlotFunction>::slot>(const
boost::_bi::bind_t &)' being compiled
with
[
SlotFunction=boost::signal1::type>::result_type,boost::detail::function_traits_helper::type>::arg1_type,boost::last_value<void>,int,std::less<int>,boost::function>::slot_function_type,
R=void,
F=boost::_mfi::mf1,
L=boost::_bi::list2>::B1,boost::_bi::list_av_2>::B2>
]
c:\Documents and Settings\mbrodeur\My Documents\Visual Studio
Projects\testboost\testboost\testboost.cpp(22) : see reference to function
template instantiation 'boost::signals::connection Subscribe<Foo>(C *,void
(__thiscall Foo::* )(int))' being compiled
with
[
C=Foo
]
thanks !
--
View this message in context: http://www.nabble.com/1.34.1%3A-boost-bind-issue-with-function-template-tp19...
Sent from the Boost - Users mailing list archive at Nabble.com.