Boost logo

Boost :

From: Rob & Lori (Rob.Lori_at_[hidden])
Date: 2003-09-09 23:37:55


Anthony, if you've aleady taken a look at my pluggable factory class,
please take another look. I've made some large changes to the way the
class is implemented and I'm quite happy with the results. I've renamed
the class to object_factory and it's new location in boost is:
http://groups.yahoo.com/group/boost/files/object_factory/

BTW, I borrowed the preprocessor technique you used in your ctor_fn
implementation to create partial specializations of my object factory
class. I hope you don't mind. I gave you credit in the headers, but I
can remove the code if you object.

Rob

Anthony Liguori wrote:

> Rob & Lori wrote:
>
>> Anthony, I took a look at your work, and I quite like it. I am
>> actually doing something very similar to the current version of my
>> pluggable factory class (which I've yet to upload to the boost files
>> section) except it never occured to me that the ctor_fn would be
>> useful outside the factory class. It seems only obvious now.
>
>
> Why thank you :-) Must admit I haven't taken a look at your factory
> class yet although I am quite curious.
>
>> Personally, I think a ctor_fn implementation should be part of boost,
>> but it seems not too many people are interested in such a feature,
>> just like factory classes. I'm still trying to figure out why.
>> Heck, there are a few boost libraries which have implemented ctor_fn
>> like functionality for their own internal use. You'd think it would
>> be about time that we made it officially part of the library.
>
>
> I don't think it's for lack of interest. It's just sufficiently
> difficult to get right and I haven't invested nearly enough time
> into. The basic problem is that you really want ctor_fn to be able to
> map any constructor. The currently version can make the constructor
> signature just fine but what would be really nice is to map any
> overloaded new operator too.
>
> For instance, for something like:
>
> A *a = new(mem) A(42);
>
> You really want to be able to express as something like:
>
> using boost::function;
>
> function<function<A *(int)> (void *)> func = boost::new_fn<function<A
> *(int)> (void *)>();
>
> A *a = func(mem)(42);
>
> The second line (declaration of func) is not necessarily the best
> syntax for it but something along those lines. Every attempt I've
> made to try to simulate this ability has failed so far. I'm not
> totally convinced it's impossible though so I'm sort of waiting for
> some inspiration (unless someone else has an idea of how such a thing
> could be achieved).
>
> I'd really like to wait to formally submit a proposal until a solution
> to overloaded new operators is found.
>
> Best Regards,
> Anthony Liguori
>
>>
>> Rob Geiman
>>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk