Y
Hacker News
new
|
ask
|
show
|
jobs
by
9emE0iL18gxCqLT
4663 days ago
"C++'s idea of a reinterpret_cast lacks sufficient cojones."
http://code.woboq.org/qt5/qtwebkit/Source/WTF/wtf/StdLibExtr...
2 comments
nly
4663 days ago
Afaik the usual practice when you want to hammer to the type system in to the dirt is to reinterpret_cast a pointer to FROM to a pointer to TO, and then dereference it. Alternatively just do a memcpy()
link
qznc
4663 days ago
Relying on undefined behavior surely shows sufficient cojones.
link