在本文中,提到了有关reinterpret_cast整数和指针的以下内容:
reinterpret_cast
(不保证相反方向的往返转换;同一个指针可能有多个整数表示)
我是否正确理解标准不保证以下内容:
intptr_t x = 5; void* y = reinterpret_cast<void*>(x); assert(x == reinterpret_cast<intptr_t>(y));
有人可以确认吗?
c++ pointers language-lawyer reinterpret-cast
c++ ×1
language-lawyer ×1
pointers ×1
reinterpret-cast ×1