AIX I/O failures
Phil Edwards
pedwards@disaster.jaj.com
Thu Jan 25 14:27:00 GMT 2001
On Thu, Jan 25, 2001 at 02:20:16PM -0800, Mark Mitchell wrote:
>
> A very similar example to the code I wrote occurs as an example in the
> standard itself:
>
> char place[sizeof(Something)];
> Something* p = new (place) Something();
Just to make this clear: the major benefit that we're getting from this
technique is
char place[sizeof(Something)];
// ... a delay in time ...
Something* p = new (place) Something();
The major difference from this example and what you first posted, and
what my problem is with the originally proposed solution -- and maybe what
Gaby's disagreement is too, although of course I cannot speak for him --
is that here "place" is a character array, and everywhere else "place" is
a Something. Using placement new to "reconstruct" an object in place is
what we are already doing during Init(). But we weren't declaring (for
example) cin as both an istream and a char[], and then using placement
new to try and overlap them.
> The only difference is that there's not the subsequent ODR violations
> that emerges in my code.
You'll have to remind me what ODR stands for, though.
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.
More information about the Libstdc++
mailing list