This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Implementing addressof for C++0x


... 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]