Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-07-17 13:14:16

"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
> [...]
> Here is another clean example using struct initiliazers which uses 1
> statement and is more solid at construction time.

I don't see how you have avoided a copy during construction. You are
calling the generated copy c'tor in the new statement. The only way
you can avoid a copy and provide a count wrapper like you have done
is to overload placement new for all possible combinations of arguments
(which isn't terribly difficult with some template and preprocessor magic,
probably...but fairly tedious to write). I've thought about this approach
before, and I'm sure hundreds have thought about it before me. This
approach is fraught with difficulties for which there appears no easy


Boost list run by bdawes at, gregod at, cpdaniel at, john at