On Wed, 2010-03-17 at 22:21 +0000, Gennadiy Rozental wrote:
> I've got specification like this:
>
> class_<Foo,FooSP>( "Foo", "Foo descr" )
> .def( "__init__", bp::make_constructor( &make_foo ),
> bp::args( "self", "str" ),
> "Constructor based on string representation.\n" )
> ...
>
> I am getting compilation error below from VC9.0. Error disappears if I avoid
> bp::args( "self", "str" ) part.
>
> Please advise,
>
You have to pass the keywords to make_constructor:
.def("__init__",
bp::make_constructor(&make_foo,
bp::default_call_policies(), bp::args("self","str"))
)
I'm not actually sure whether to put the docstring in the call to
make_constructor (I'll let you experiment), but you do have to supply
the call policies argument manually if you want to supply keywords -
make_constructor just doesn't have the overloads that make_function
does.
Jim Bosch
_______________________________________________
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig