0

if I have a struct:

struct v2 {
    int x, y;
}

I could use operator overloading to be able to do stuff like:

v2 v = {1, 2}, _v = {1, 1};
v = v + _v; // v = {2, 3};

but what do I do if I want to also be able to do stuff like:

v2 v = {1, 2};
v = v + {1, 1}; //v = {2, 3}
Ace shinigami
  • 1,374
  • 2
  • 12
  • 25

0 Answers0