Skip to content

Instantly share code, notes, and snippets.

@ayyess
Last active August 29, 2015 14:12
Show Gist options
  • Save ayyess/1eadae335d8570747bde to your computer and use it in GitHub Desktop.
Save ayyess/1eadae335d8570747bde to your computer and use it in GitHub Desktop.
struct name being used for scope resolution
#include <iostream>
int main(int /*_argc*/, char ** /*_argv*/)
{
struct Foo {
Foo() {
std::cout << "foo" << std::endl;
}
};
Foo();
Foo::Foo();
Foo::Foo::Foo();
Foo::Foo::Foo::Foo::Foo::Foo::Foo::Foo::Foo::Foo::Foo();
return 0;
}
@ayyess
Copy link
Author

ayyess commented Dec 28, 2014

outputs:

foo
foo
foo
foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment