4 ms·
? I can't even remember the last time I've seen a bug that came from implicit casting, apart from there being compiler warnings that will tell you about them.
by roel_v 12y ago
? I can't even remember the last time I've seen a bug that came from implicit casting, apart from there being compiler warnings that will tell you about them.
I don't see how one can reasonably argue that type conversion is like 'rolling a die' - well yeah, if you use auto all over, it can be, which is my whole point. Next thing we'll need unit tests just to make sure a type change in place A doesn't make part B fall over - just like in scripting languages. Judicious use of auto to make iterators less painful to type; OK. 'auto' for types in templates where you don't know the type yet - that's a genuinely useful case (although there aren't that many cases where it's useful). 'auto' for every type just because that way you don't have to think about types - recipe for disaster and source of unexpected bugs, imo.