[C++-sig] How do I wrap a static member function?

Ravi lists_ravi at lavabit.com
Sat Oct 31 04:43:31 CET 2009


Use class_.staticmethod(...) as shown below:

On Friday 30 October 2009 17:47:45 James Amundson wrote:
> BOOST_PYTHON_MODULE(foo)
> {
>      class_<Foo>("Foo",init<>())
>      .def("doit", &Foo::doit)

       .staticmethod( "doit" )

>      .def("nonstatic_doit", &Foo::nonstatic_doit)
>      ;
> }
 
Regards,
Ravi



More information about the Cplusplus-sig mailing list