[C++-sig] Re: sub module support in V2

David Abrahams david.abrahams at rcn.com
Sun Jun 9 23:49:31 CEST 2002


From: "Dave Hawkes" <daveh at cadlink.com>

> "David Abrahams" <david.abrahams at rcn.com> wrote in message
> news:25c701c20f6d$6bdb20d0$6601a8c0 at boostconsulting.com...

> In addition if a class is contructed multiple times it will find itself
and
> add to the previous definition, so we can do this,
>
>     class_<ctest>("ctest")
>         .def_init()
>         .def("set_v", &ctest::set_v);
>     class_<ctest>("ctest")
>         .def("get_v", &ctest::get_v);
>
> to build support for a single class. This has more to do with consistancy
> and safety, rather than any coding efficiency.

Those sound like good choices. It might be difficult to get nested classes
to work, but maybe that scoping is best done using the class name:

    class<ctest::nested>("ctest.nested")
        ...
        ;

-Dave







More information about the Cplusplus-sig mailing list