Should I really use static_cast every single time I want to convert between primitive types?

Viewed 5736

What makes this

long l = 1;
char c = static_cast<char>(l);

float f = 1.0f;
int i = static_cast<int>(f);

better than this

long l = 1;
char c = (char)l;

float f = 1.0f;
int i = (int)f;

when casting one primitive data type to another?

I've got much of legacy code that uses the second style for type casting in similar situations, so this is also a question about should I or may I not perform full-scale revision of that code.

5 Answers
Related