"David B. Held" <[EMAIL PROTECTED]> wrote in message
aslftb$cr2$[EMAIL PROTECTED]">news:aslftb$cr2$[EMAIL PROTECTED]...
> "Eric Woodruff" <[EMAIL PROTECTED]> wrote in message
> aslbsn$nt3$[EMAIL PROTECTED]">news:aslbsn$nt3$[EMAIL PROTECTED]...
> > [snip]
> >
> > > holder<Foo> h;
> > > new (h.storage) Foo;
> >
> > What is the meaning of that syntax?
>
> This is placement new syntax.  It means construct a Foo at the address
> h.storage, without allocating any memory.
>

So the type really is of Foo, which has to mean that casting h.storage back
to a Foo* using reinterpret_cast is covered by the standard.


> > >    ...
> > > T* u = dangerous_cast<T*>(h.storage); // can't do this with
> > > reinterpret_cast
> >
> > Why would you want to do that in the first place.
>
> Because you want to get at the T in h in a portable way.  Which brings
> me to my next point.  Since it seems this is the only context in which
this
> cast is guaranteed to give a meaningful result, maybe it should be called
> placement_cast<>?
>
> Dave
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to