2 ms·
Casts don't change the type of an object. They might create a new object of another type from the first one. edit: I guess what you want to say is that implici
by gpderetta 3y ago
Casts don't change the type of an object. They might create a new object of another type from the first one.
edit: I guess what you want to say is that implicit casts make a type system weak. But even there there is plenty of wiggle room: I think that everybody agree that implicitly converting the string "1" to an integer is bad (which is not allowed in C++). Narrowing conversions are arguably bad (they are sometimes allowed in C++), but some other implicit conversions are hard to argue against (int to long for example, or derived to base).