[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppReinterpretCast
Avoid using reinterpret_cast [1].
Don't use C-style casts [2].
Other casts are:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppReinterpretCast
(C++) reinterpret_cast
Keyword enabling casting between unrelated data types, e.g. an int to a pointer.Avoid using reinterpret_cast [1].
Don't use C-style casts [2].
Other casts are:
- static_cast, for casting between simple data types (e.g. between int and double)
- const_cast, for casting away const
- dynamic_cast, for casting between related classes
References
- 1) Herb Sutter and Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 92: 'Avoid using reinterpret_cast'
- 2) Herb Sutter and Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 95: 'Don't use C-style casts'
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
