Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-05-18 18:55:50


Anthony Liguori <anthony_at_[hidden]> writes:

> Greetings all,
>
> I'm writing to see if there is interest in a little library I wrote a
> while back that provides virtual constructor semantics by allowing
> constructors to be represented as function objects. I've took an
> initial shot at boostifing the code (although the documentation needs
> a little work). I think it would go along nicely with the
> pre-existing boost::mem_fn() library (either as part of or as a
> compliment). I've include a link to the library and also a quick
> snippet of it's usage:
>
> http://aliguori.dyndns.org/boost/ctor_fn.html
>
> This is not a formal submission, I just wanted to see if there's
> interest in this before I went through and boostified the
> documentation. Also, I've only tested the library on GCC-3.x...

It's really interesting! :) I don't understand it, though :(

I've never understood what people meant by "virtual constructor"
anyway. The closest thing I can imagine is "clone() member function",
but that doesn't appear to be quite what you're doing.

Can this thing handle construction in raw memory, or does it always
do a dynamic allocation?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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