In this article I refer to the entire index and indexes: reinterpret_cast
reinterpret_cast
(conversion in the opposite direction in the opposite direction is not guaranteed, the same pointer can have several integer representations)
Do I understand correctly that the standard does not guarantee the following:
intptr_t x = 5; void* y = reinterpret_cast<void*>(x); assert(x == reinterpret_cast<intptr_t>(y));
Can anyone confirm?
Your interpretation is correct. The relevant clause of the standard is [expr.reinterpret.cast] / 5 in C ++ 17:
. , ( ) ; . [. , 6.7.4.3, . - ]
, ( ), , ; , ", ". cppreference, , .
, . intptr_t , , , , , pigeonhole , void*.
intptr_t
void*
Source: https://habr.com/ru/post/1691567/More articles:Shell Scripting The ternary operator to get the result of a string - string/ usr / include is missing from NDK (r16b) - androidLog precision in python - pythonHow can I get the NUnit3TestAdapter to work with .Net Standard 2.0? - nunitUnable to list after filter - pythonGoogle login failed: auth / redirect-cancel-by-user - cordovaDoes Stream.sorted (). Does ForEach () work as intended? - javaRemove values 00 from TIME_FORMAT () - sqlRequire npm module with browser cannot find dependency - javascriptdictionary and insert search - pythonAll Articles