-7

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

Baum mit Augen
  • 47,658
  • 24
  • 139
  • 177
rocky
  • 11
  • 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
  • 102,989
  • 8
  • 160
  • 277