[RFC] Implementing addressof for C++0x

Paolo Carlini paolo.carlini@oracle.com
Thu May 20 11:16:00 GMT 2010


On 05/20/2010 01:10 PM, Paolo Carlini wrote:
> ... for reference, it would be something like this (in my recollections,
> it was even uglier ;)
>
> template<typename _Tp>
>   _Tp*
>   addressof(_Tp& __v)
>   {
>     return reinterpret_cast<_Tp*>
>       (&const_cast<char&>(reinterpret_cast<const volatile char&>(__v)));
>   }
>   
By the way, Peter (I think you are the author of the current boost
implementation, which I looked at yesterday), in case we end up having
something like the above, temporarily at least, which kind of
acknowledgment would you be Ok with? Is it enough your name in the
ChangeLog?

Thanks,
Paolo.



More information about the Libstdc++ mailing list