|
Re: def( str( self)) error: msg#00256python.c++
Jonathan Brandmeyer <jbrandmeyer@xxxxxxxxxxxxx> writes: > using namespace boost::python; > > BOOST_PYTHON_MODULE(libphysics) > { > class_< physics::vector>( "vector") > .def( str( self)) > ; > } > > compiled with: > $ g++-3.2 -c -o testme.lo -fpic -I/usr/include/python2.2 testme.cpp > testme.cpp: In function `void init_module_libphysics()': > testme.cpp:67: no matching function for call to ` > boost::python::class_<physics::vector, > boost::python::detail::not_specified, > boost::python::detail::not_specified, > boost::python::detail::not_specified> > ::def(boost::python::str)' Easy workaround: BOOST_PYTHON_MODULE(libphysics) { class_< physics::vector>( "vector") .def( self_ns::str( self)) ^^^^^^^^^ ; } GCC seems to have some problems with the Koenig Lookup rules :(. -Dave -- Dave Abrahams Boost Consulting www.boost-consulting.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: instantiating python objects within C++: 00256, Stefan Seefeld |
|---|---|
| Next by Date: | Re: Recent changes to FAQ: 00256, David Abrahams |
| Previous by Thread: | Re: def( str( self)) errori: 00256, Jonathan Brandmeyer |
| Next by Thread: | Assertion Error using Pyste: 00256, Brian Luft |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |