Operator overloading; looks like we agree.
Exceptions do control flow, even if you just use them to report errors. They're often effectively hidden gotos.
Operator overloading; looks like we agree.
Exceptions do control flow, even if you just use them to report errors. They're often effectively hidden gotos.
But that is a property of inheritance and virtual functions, not something inherent to C++. You could be using another object-oriented language and the logic would be as hard to follow. We could discuss why or why not that property is problematic, but that would be straying from the topic, which is C++.
> Exceptions do control flow, even if you just use them to report errors. They're often effectively hidden gotos.
Again, same logic can be applied to any language that supports exceptions.
Composition over inheritance is a technique used to reduce this problem.
[1] http://en.wikipedia.org/wiki/Composition_over_inheritance