-7

I want to know if there is any difference between simple binary operator overloading and assignment operator overloading.

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
rocky
  • 1
  • 6

1 Answers1

3

Here are two differences:

  1. An overloaded assignment operator must be a member of the class being assigned to; it cannot be declared as a free function.
  2. Copy and move assignment operators will be implicitly declared for your class if you do not declare them yourself (subject to certain restrictions).
Brian Bi
  • 111,498
  • 10
  • 176
  • 312