Is reinterpret_cast type punning actually undefined behavior?
问题 It appears to be widely-held that type punning via reinterpret_cast is somehow prohibited (properly: "undefined behavior", that is, "behavior for which this International Standard imposes no requirements", with an explicit note that implementations may define behavior) in C++. Am I incorrect in using the following reasoning to disagree, and if so, why ? [expr.reinterpret.cast]/11 states: A glvalue expression of type T1 can be cast to the type “reference to T2 ” if an expression of type