This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] Implementing addressof for C++0x
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Thu, 20 May 2010 13:10:03 +0200
- Subject: Re: [RFC] Implementing addressof for C++0x
- References: <4BF50A18.20406@oracle.com>
... 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)));
}
I'm not sure...
Paolo.