Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-03-24 12:00:41


Vaclav Vesely <vaclav.vesely_at_[hidden]> writes:

> However the conclusion of the article is, that ok1() is better than
> ok2() because you have to write helper functions. I don't agree. IMHO
> ok2 IS better and the helper functions should be in the library (so the
> uses doesn't have to write them. What do you think?

Yes, the library ought to contain something like that, as I have been
saying for years. Probably it should be spelled something like:

     new_<shared_ptr<T> >(a, b, c, ...)

     new_<auto_ptr<T> >(a, b, c, ...)

Unfortunately, really making these functions work correctly for more
than about 5 or 6 arguments is currently not feasible because of
what's known as "the forwarding problem" (google it).

Boost Consulting is working on a project where we'll need this
functionality, so I hacked up the enclosed. I'm going to generalize
it (and hopefully, optimize compilation speed) a bit and try to get it
into Boost. In the meantime, enjoy.



 

-- 
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