Skip to content

Instantly share code, notes, and snippets.

@tsunghanlin
Created December 29, 2013 11:02
Show Gist options
  • Save tsunghanlin/8169318 to your computer and use it in GitHub Desktop.
Save tsunghanlin/8169318 to your computer and use it in GitHub Desktop.
struct A {
double x;
} _;
A& operator^(double x, A& a) {
a.x = x;
return a;
}
double operator^(A& a, double y) {
return a.x/y + y/a.x;
}
int main() {
double x = 1, y = 2;
cout << (x ^_^ y) << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment