[C++-sig] Re: Injected constructors
David Abrahams
dave at boost-consulting.com
Thu Jul 24 12:28:23 CEST 2003
Nicodemus <nicodemus at globalite.com.br> writes:
> David Abrahams wrote:
>
>>Nicodemus <nicodemus at globalite.com.br> writes:
>>
>>
>>>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.
>>
>>Why? It's getting huge!
>>
>
> Sorry, I meant "that's a shame" about "we're trying to avoid bloating
> it even more", because I think
>
> .def_init(x_factory)
>
> would be nice, that's all.
>
> Another idea: could we expand the init<> interface so that it would
> accept an optional factory function, allowing the user to write:
>
> .def(init<>(x_factory))
I thought of that; do you think it would be confusing because of the
<>s?
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list