Skip to content

Instantly share code, notes, and snippets.

@aruslan
Created February 13, 2012 22:17
Show Gist options
  • Save aruslan/1820939 to your computer and use it in GitHub Desktop.
Save aruslan/1820939 to your computer and use it in GitHub Desktop.
Explicit constructors all over the place
struct foo
{
explicit foo(int a) {}
explicit foo(const foo&) {}
};
int main()
{
foo a(42);
foo b = a; // breaks because the copy constructor is explicit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment