[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.1 (work1) now available
- From: Coda Highland <chighland@...>
- Date: Sat, 7 Apr 2012 14:20:32 -0500
> Whether you agree of not does not really matter,static_cast is the
> correct cast to use and the result of reinterpret_cast is mostly
> implementation specific.
No, it's quite well-defined: "Converting a prvalue of type “pointer to
T1” to the type “pointer to T2” [...] and back to its original type
yields the original pointer value." The fact that the C++03 spec
doesn't make it clear that void* is allowed as T1 or T2 in this
context is in fact an error and the C++11 spec corrects this (see
defect 1120) -- and this is how every C++ compiler in common use does
it. So reinterpret_cast'ing to void* and back is guaranteed safe.
/s/ Adam
- References:
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Rena
- Re: [ANN] Lua 5.2.1 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.2.1 (work1) now available, Coda Highland
- Re: [ANN] Lua 5.2.1 (work1) now available, Peter Cawley
- Re: [ANN] Lua 5.2.1 (work1) now available, Patrick Rapin
- Re: [ANN] Lua 5.2.1 (work1) now available, Coda Highland
- Re: [ANN] Lua 5.2.1 (work1) now available, Patrick Rapin
- Re: [ANN] Lua 5.2.1 (work1) now available, Coda Highland
- Re: [ANN] Lua 5.2.1 (work1) now available, liam mail