Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-12-04 15:04:18


From: "Gabriel Dos Reis" <gdr_at_[hidden]>
> David Abrahams <dave_at_[hidden]> writes:
>
> | Gabriel Dos Reis <gdr_at_[hidden]> writes:
> |
> | > Hmm, I have a couple of questions answers to which will help me
> | > get your point.
> | >
> | > 1) Why can't you do that with reinterpret_cast?
> |
> | You can, but the results are non-portable
>
> No more non-portable than with dangerous_cast<>.

I think that Dave's point is that in

new(h.storage) Foo;

there is a char* -> void* implicit conversion as placement new takes a
void*. So the placement new performs char* -> void* -> Foo* (by constructing
a Foo at (void*)h.storage), which - in theory - might not be the same as
char* -> Foo*.


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