Created
August 9, 2009 21:38
-
-
Save simonask/164910 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
static int n = 0; | |
class A { | |
public: | |
virtual void foo() { | |
++n; | |
} | |
}; | |
class B : public A { | |
public: | |
void foo() { | |
++n; | |
return; | |
} | |
}; | |
class C : public B { | |
public: | |
void foo() { | |
++n; | |
} | |
}; | |
class D : public C { | |
public: | |
void foo() { | |
++n; | |
} | |
}; | |
int main (int argc, char const *argv[]) | |
{ | |
for (int i = 0; i < 10000000; ++i) | |
{ | |
A a; | |
a.foo(); | |
B b; | |
b.foo(); | |
C c; | |
c.foo(); | |
D d; | |
d.foo(); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment