|
MSVC++, bind and namespaces: msg#00315lib.boost.user
I've just encountered this problem and it looks like a MS bug. Not sure it deserves a Boost workaround but I thought it would be nice to let you know (in case you don't already). Here's the code: #include <boost/bind.hpp> namespace A{ struct c{ void setName(const char*) {} }; } namespace B{ struct c{ void setName(const char*) {} }; } using namespace B; using namespace A; int main() { boost::bind(&A::c::setName, _1, _2); return 0; } It looks legal to me but I'm no expert. GCC compiles with no warnings but MSVC++ 6sp5 gives the error below. boost/bind/mem_fn_vw.hpp(29) : error C2872: 'c' : ambiguous symbol boost/bind.hpp(875) : see reference to class template instantiation 'boost::_mfi::mf1<void ,struct A::c,char const *>' being compiled boost/bind.hpp(886) : see reference to class template instantiation 'boost::_bi::bind_t_generator<void>::implementation<struct boost::_mfi::mf1<void,struct A::c,char const *>,class boost::_bi::list2<class boost::arg<1>,class boost::arg<2> > >' being compiled test.cpp(15) : see reference to class template instantiation 'boost::_bi::bind_t<void,struct boost::_mfi::mf1<void,struct A::c,char const *>,class boost::_bi::list2<class boost::arg<1>,cla ss boost::arg<2> > >' being compiled boost/bind/mem_fn_vw.hpp(31) : error C2872: 'c' : ambiguous symbol boost/bind.hpp(875) : see reference to class template instantiation 'boost::_mfi::mf1<void,struct A::c,char const *>' being compiled boost/bind.hpp(886) : see reference to class template instantiation 'boost::_bi::bind_t_generator<void>::implementation<struct boost::_mfi::mf1<void,struct A::c,char const *>,class boost::_bi::list2<class boost::arg<1>,class boost::arg<2> > >' being compiled test.cpp(15) : see reference to class template instantiation 'boost::_bi::bind_t<void,struct boost::_mfi::mf1<void,struct A::c,char const *>,class boost::_bi::list2<class boost::arg<1>,class boost::arg<2> > >' being compiled Best, Andre Hentz ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get 128 Bit SSL Encryption! http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/EbFolB/TM ---------------------------------------------------------------------~-> Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@xxxxxxxxxxxxxxx> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Is intrusive_ptr the thing to use?: 00315, Peter Dimov |
|---|---|
| Next by Date: | Re: ublas::matrix sharing storage with ublas::vector: 00315, Stephen Crowley |
| Previous by Thread: | Re: ublas::matrix sharing storage with ublas::vecto ri: 00315, Toon Knapen |
| Next by Thread: | RE: MSVC++, bind and namespaces: 00315, Antoine Boivin Filion |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |