Given code like the following:
int32_t a = some large value;
int16_t x = a;
I believe that best practices would suggest allowing the compiler to perform an implicit cast from int32_t to int16_t. In my code however I often feel that this is more clear:
int16_t x = static_cast<int16_t>( a );
Is this "correct" or simply verbose? My goal is to ensure that future readers understand the deliberate nature of the truncation.
The reason I ask this question is that my code is filled with tons of explicit casts purely for clarity, which I understand is ill advised.