The following code works fine:

    using namespace boost::python;

    class X {};

    X* make_X(int n, float f) { return new X; }

    BOOST_PYTHON_MODULE(Test)
    {
        class_<X>("X")
        .def(
            "__init__",
            make_constructor(&make_X)
            //,(arg("n"), arg("f") = 1.0f)
        );
    }

But if I uncomment the commented line, then the code does not compile.
How do I fix that?

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to