[C++-sig] [boost-python] overloading problem

Neal D. Becker ndbecker2 at verizon.net
Thu Apr 8 18:57:50 CEST 2004


I'm having trouble with overloading.  It seems to work for default args, but
not for a family of fncs with common prefix.  This is on gcc-3.3.3.

#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/python/class.hpp>
#include <boost/python/init.hpp>
#include <boost/python/overloads.hpp>

using namespace boost::python;

struct george
{
  void wack_em(int a) {}
  void wack_em(int a, int b) {}
};

BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(george_overloads, wack_em, 1, 2)

  BOOST_PYTHON_MODULE (GEORGE) {
  class_<george> ("george")
    .def("wack_em", &george::wack_em, george_overloads())
    ;
}

g++ -c Test3.cc -I/usr/include/python2.3
Test3.cc: In function `void init_module_GEORGE()':
Test3.cc:19: error: no matching function for call to `
   boost::python::class_<george, boost::python::detail::not_specified, 
   boost::python::detail::not_specified,
boost::python::detail::not_specified>
   ::def(const char[8], <unknown type>, george_overloads)'





More information about the Cplusplus-sig mailing list