Created
March 24, 2020 17:19
-
-
Save greg-hellings/0186f98c457476e1912f2825136d7770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Poop { | |
public: | |
Poop(int i, int j) : | |
x(i), | |
y(j) {} | |
int x = 0; | |
int y = 0; | |
}; | |
Poop operator + (int q, Poop f) { | |
f.x += q; | |
return f; | |
} | |
int main() { | |
Poop p(1, 2); | |
p = 7 + p; | |
std::cout << p.x << " " << p.y << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment