Skip to content

Instantly share code, notes, and snippets.

@meshell
Created February 22, 2016 21:16
Show Gist options
  • Save meshell/58d0b10d068c2ade9ede to your computer and use it in GitHub Desktop.
Save meshell/58d0b10d068c2ade9ede to your computer and use it in GitHub Desktop.
// Until C++11
template<class T>
struct p
{
typedef T* Type;
};
p<float>::Type y; // y is of type float*
// Since C++11: alias template
template<class T>
using ptr = T*;
ptr<int> x; // x is of type int*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment