[C++-sig] Re: Injected constructors

Nicodemus nicodemus at globalite.com.br
Thu Jul 24 00:48:40 CEST 2003


David Abrahams wrote:

>"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> writes:
>  
>
>>Yet another idea:
>>
>>.def_factory(x_factory)
>>
>>It means expanding the class_<> interface, but I think the purpose
>>is unique enough to warrant the additional member function.
>>    
>>
>
>Actually, we're trying to avoid bloating it even more.  Joel is about
>to commit a simple mechanism which even allows us to move the
>pickle_suite functionality out of class_.
>

Hmm, that's a shame. I think that:

.def_init(x_factory)

would be good enough. If the bloating is really a problem, I think 
Ralph's suggestion:

.def(init_factory(x_factory))

is nice too.

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list