Skip to content

Instantly share code, notes, and snippets.

@loliGothicK
Created April 25, 2018 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loliGothicK/8258162340ccb4c64581e726466f1c33 to your computer and use it in GitHub Desktop.
Save loliGothicK/8258162340ccb4c64581e726466f1c33 to your computer and use it in GitHub Desktop.
template < class T >
struct X
{
X( T t ) { }
};
int main()
{
X x1(0); // X<int>.
X x2(0.0); // X<double>.
X x3("hello"); // X<char const *>.
X x4 = 0; // X<int>. Same as x1.
X x5 = 0.0; // X<double>. Same as x2.
X x6 = "hello"; // X<char const *>. Same as x3.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment