Almost a rehash of What's the difference between function(myVar) and (function)myVar?
But I want to know:
What is the name of these variants and are they 'bad'?
type(myVar)
is constructor like syntax, but for a basic type is it the same as doing a C-style cast which is considered bad in C++?
(type)myVar
this one certainly does seem to be a C-style cast and thus must be bad practice?
I've seen some instances where people replace things like (int)a
with int(a)
citing that the C-style version is bad/wrong yet the linked question says they're both the same!