4 ms·
Love this kind of hacking at the edges of the standard. Which of the attempted schemes are legal (implementation-defined) C++ when used at runtime? All of them
by twoodfin 11y ago
Love this kind of hacking at the edges of the standard.
Which of the attempted schemes are legal (implementation-defined) C++ when used at runtime? All of them? I'm pretty sure the memcpy() approach has to be kosher, at least.
EDIT:
Don't have a copy of the standard handy, but cppreference[1] suggests using reinterpret_cast<> is UB.
[1] http://en.cppreference.com/w/cpp/language/reinterpret_cast http://en.cppreference.com/w/cpp/language/reinterpret_cast