[C++-sig] Re: pure virtual methods with pyste
Nicodemus
nicodemus at globalite.com.br
Tue Jul 29 03:22:37 CEST 2003
David Abrahams wrote:
>David Abrahams <dave at boost-consulting.com> writes:
>
>
>
>> BOOST_PYTHON_MODULE(test)
>> {
>> class_<Abstract, AbstractWrap, boost::noncopyable>("Abstract")
>> .def("a", &Abstract::a)
>> .def("a", &AbstractWrap::default_a)
>> ;
>>
>> def("call", call);
>> }
>>
>>I just wish I knew a way to detect that a function was pure-virtual so
>>we could have Boost.Python generate that default_a automatically.
>>
>>
>
>Perhaps this interface would be nice:
>
> BOOST_PYTHON_MODULE(test)
> {
> class_<Abstract, AbstractWrap, boost::noncopyable>("Abstract")
> .def("a", pure_virtual(&Abstract::a))
> ;
>
> def("call", call);
> }
>
>??
>
Seems nice enough for me. 8)
More information about the Cplusplus-sig
mailing list