Joel de Guzman wrote:
Roman Yakovenko wrote:
Hi. I could be wrong, but it seems to me that the Boost.Python tutorials contains bug. ( http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#pyt... <http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#pyt...> )
The compiler ( I use msvc 7.1 ) is not able to compile the code. The main reason is that it can not decide what "f" to select. I mean, it does not know what address it should pass to "def" function. The same thing occurs for BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS. It seems to me that it is right.
Some thoughts. I think, that in this case( auto-overloading example ) function "def" should not take reference to function. It should be enough to pass an instance of the constructed class. Same logic could be applied on class_::def method too.
I am not quite sure what you mean. Please see defaults.cpp in the libs/python/test directory. The example compiles just fine with VC7.1. If you are not convinced, you might want to provide a minimal sample code that we can try.
Ok, disregard that. I did check it out and the error is the def it should be: .def("foo", (void(*)(bool, int, char))0, foo_overloads()); I fixed the docs and updated to CVS. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net