compile time error triggered by gcc's '-pedantic' flag
hi there, I'm compiling a python extension containing a method returning an internal pointer, so I use: namespace { class Foo {}; class Bar { public: Foo *foo() { return &my_foo;} private: Foo my_foo; }; } BOOST_PYTHON_MODULE(Sandbox) { python::class_<Foo, boost::noncopyable> foo("Foo", python::no_init); python::class_<Bar, boost::noncopyable> bar("Bar", python::no_init); bar.def("foo", &Bar::foo, python::return_internal_reference<>()); } Whenever I try to compile that with gcc -pedantic, I get an error which ends with the lines ... /usr/local/ORTHOsoft/include/boost/python/class.hpp:253: instantiated from `boost::python::class_<T, X1, X2, X3>& boost::python::class_<T, X1, X2, X3>::def(const char*, A1, const A2&) [with A1 = <unnamed>::Foo*(<unnamed>::Bar::*)(), A2 = boost::python::return_internal_reference<1, boost::python::default_call_policies>, T = <unnamed>::Bar, X1 = boost::noncopyable, X2 = boost::python::detail::not_specified, X3 = boost::python::detail::not_specified]' /homes/Developer/sseefel/error.cc:22: instantiated from here /usr/local/ORTHOsoft/include/boost/python/object/make_ptr_instance.hpp:37: invalid use of member `boost::mpl::bool_<false>::type' As a quick fix I'll just drop the '-pedantic' flag but I'm curious as to whether this is a problem with the boost::python code or with gcc. I'm using boost 1.30 and gcc 3.2, by the way. Thanks a lot, Stefan
Stefan Seefeld <stefan.seefeld@orthosoft.ca> writes:
As a quick fix I'll just drop the '-pedantic' flag but I'm curious as to whether this is a problem with the boost::python code or with gcc. I'm using boost 1.30 and gcc 3.2, by the way.
This was fixed in the CVS shortly after 1.30 went out. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
David Abrahams -
Stefan Seefeld -
Stefan Seefeld