2010/5/20 Kun Hong <kun.h...@uqconnect.edu.au>

>
>
> class B
> {
> public:
>        virtual const char *getName() const = 0;
> };
>
> BOOST_PYTHON_MODULE(Test)
> {
>
>        class_<B, boost::noncopyable>
>            ("B", no_init)
>                .def("getName", pure_virtual(&B::getName))
>        ;
>
>        def("getB", &getB,
> return_value_policy<reference_existing_object>());
> }
>
> When you expose your method getName, expose it like a classic method,
without the pure_virtual. The C++ will perform the virtual call itself.
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to