[C++-sig] Py++ exposing default constructors twice?

Roman Yakovenko roman.yakovenko at gmail.com
Mon Jun 9 19:54:39 CEST 2008


2008/6/8 Hans Meine <meine at informatik.uni-hamburg.de>:
> Hi,
>
> py++ generates code like this:
>
>    bp::class_< Foo >( "Foo" )
>        .def( bp::init< >() )
>    ...
>
> AFAIK, the first like already exposes the default constructor (since no_init
> was not given), thus I would expect the second line to be superfluous?!

You are right .

There few cases, where Py++ generates not optimal code. This specific
case is one of them. Class registration and construction is tricky.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list