In C++11 you can create a "type alias" by doing something like
template <typename T>
using stringpair = std::pair<std::string, T>;
But this is a deviation from what you'd expect a template typedef would look like:
template <typename T>
typedef std::pair<std::string, T> stringpair;
So this raises the question – why did they need to come up with a new syntax? what was it that did not work with the old typedef
syntax?
I realize the last bit doesn't compile but why can't it be made to compile?
Best Answer
I'll just refer to stroustrup himself:
http://www.stroustrup.com/C++11FAQ.html#template-alias