Skip to content

Instantly share code, notes, and snippets.

@selenologist
Created March 10, 2016 04:47
Show Gist options
  • Save selenologist/32e465e604a39a927449 to your computer and use it in GitHub Desktop.
Save selenologist/32e465e604a39a927449 to your computer and use it in GitHub Desktop.
/* EVIL */
#include <iostream>
using namespace std;
typedef int Foo;
typedef unsigned int Bar;
class A{
public:
A(Foo a){
cout << "Foo!" << endl;
}
A(Bar b){
cout << "Bar!" << endl;
}
};
int main(){
A B(static_cast<Foo>(4));
A C(static_cast<Bar>(4));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment