2 ms·
Pop Quiz, what's the difference between auto x = y; and ConcreteClass x = y; The difference, of course, is that y wasn't actually of type ConcreteCl
by moomin 11y ago
Pop Quiz, what's the difference between
auto x = y;
and
ConcreteClass x = y;
The difference, of course, is that y wasn't actually of type ConcreteClass and you've just performed a potentially incorrect or inefficient cast.
auto isn't perfect in this regard, though. auto x = y where y is ConcreteClass& makes x ConcreteClass, not ConcreteClass& (there are reasons for this, but it's still a potential source of nasty perf bugs).
And yeah, you're going to have to relearn how to reason about code. This isn't a bad thing.