标签: c++ c++11 const-cast addressof
这可能是重复的[link],但答案很短,不太清楚。在这样的可能实现中:
template <class T> T * addressof(T & v) { return reinterpret_cast<T *>(& const_cast<char&>(reinterpret_cast<const volatile char &>(v))); }
为什么需要const_cast?
const_cast