Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 385 Bytes

casts.md

File metadata and controls

8 lines (5 loc) · 385 Bytes

Casts

Always be as explicit as possible when casting primitive types. This also means using static_cast<T>() in C++ instead of the standard C-Style cast (T).

{% hint style="info" %} REASONING: The compiler will throw an error or warning when doing a conversion you shouldn't. Plus, explicit casting clarifies any confusion to the compiler or other developers. {% endhint %}