[C++-sig] class registration - bug or feature?

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Fri Jul 7 20:26:04 CEST 2006


--- Roman Yakovenko <roman.yakovenko at gmail.com> wrote:

> Boost.Python already provides the mechanism, that resolves the problem
> - def_visitor, but the changes I have to make to code generator are
> too big.
> I can not commit my self to this task :-(. So, I just searched for work
> around.
> This one seems to be the perfect one, and I need only few hours to implement
> it.

David, would it be feasible to formalize this approach? I had situations, too,
in which it was quite inconvenient to drag around the class_<X> object. It
would be nice to be able to do something like this:

file1.cpp

  class_<X, bases<Y>, shared_ptr<X>, noncopyable>("X");

file2.cpp

  registered_class<X>()
    .def("foo", &X::foo)
  ;

I.e. the new thing here would be registered_class<>, where I don't have to
repeat bases, holder, etc. It would be my responsibility to make sure the
primary class_<> is processed (at runtime) before registered_class<>.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Cplusplus-sig mailing list