-2

I was given a question: how operator overloading in C++ impacts on performance?

I'm not pretty sure how to answer it. I fully understand the idea and how to overload operators in C++, but what about performance?

tomdavies
  • 1,896
  • 5
  • 22
  • 32

1 Answers1

3

Calling an overloaded operator is the same as calling any function in the object. If you mark the operator as inline, you get the same benefits (or lack thereof) as any other inline function.

Nothing complicated at all.

Michael Kohne
  • 11,888
  • 3
  • 47
  • 79
  • 1
    About `inline`: http://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method – chris Jul 05 '14 at 17:25