Created
December 5, 2014 11:37
-
-
Save Kaali/febdfd7670b681d21097 to your computer and use it in GitHub Desktop.
w00t
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
typedef unsigned char TYPE; | |
struct Foo { | |
TYPE p, a, i, r, s; | |
Foo() {} | |
Foo(TYPE p, TYPE a, TYPE i, TYPE r, TYPE s) : p(p), a(a), i(i), r(r), s(s) {} | |
Foo operator+(Foo const& x) { | |
return Foo(p + x.p, a + x.a, i + x.i, r + x.r, s + x.s); | |
} | |
}; | |
int main(int argc, char** argv) { | |
Foo a(argc, argc, argc, argc, argc); | |
Foo b(10, 20, 30, 40, 50); | |
int p; | |
for (int i = 0; i < 1000; i++) { | |
p += (a + b).p; | |
a.p++; | |
} | |
return p; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment