Is operator overloading for classes and structs always resolved at compile-time?
2 Answers
Yes, always.
2 Comments
Lort
I wondered because apparently it isn't in Delphi, because there are speed differences
Björn Pollex
@Lort: This sort of information should be part of your question.
Yes. Only dynamic type-specific behavior achievable in C++ is through virtual member functions.
2 Comments
Steve Jessop
And note that operator overloads can be virtual member functions. The overload is still resolved at compile-time, though, so the answer is correct. It's the override which is dynamic.
Dan
@Steve - nice distinction & explanation.