C++ cast to void
问题 As I understand, C++ standard says that casting to void is correct only in case of function-style casting ( ISO/IEC 14882:2003, 5.2.3 ). But I can't find anything about C-style casting to void in C++ standard. Is behavior of program only implementation-defined in this case ? 回答1: As I understand, C++ standard says that casting to void is correct only in case of function-style casting No, it can be done by static_cast , and therefore also by conversions using functional or cast notation. But I