I know that in C++11 we can now use using
to write type alias, like typedef
s:
typedef int MyInt;
Is, from what I
The using syntax has an advantage when used within templates. If you need the type abstraction, but also need to keep template parameter to be possible to be specified in future. You should write something like this.
template struct whatever {};
template struct rebind
{
typedef whatever type; // to make it possible to substitue the whatever in future.
};
rebind::type variable;
template struct bar { typename rebind::type _var_member; }
But using syntax simplifies this use case.
template using my_type = whatever;
my_type variable;
template struct baz { my_type _var_member; }