- const_cast removes const, volatile or __unaligned attributes
- dynamic_cast must be transforming into a pointer or a reference to a class, or void pointer
- static_cast is for transforming into a superclass pointer or reference, or between non-class (i.e., basic data) types or void pointers
- reinterpret_cast can be used for everything
c++强制类型转换
最新推荐文章于 2024-04-13 20:22:04 发布