0

In C++03, you couldn't template aliases, but since C++11 it's allowed with the using syntax.

For example, the following (using typedef) is invalid:

template<class T>
typedef vector<T> v;

Whereas the following (using using) is fine:

template<class T>
using v = vector<T>;

My question is not related to the rationale of The Committee for only supporting templated aliases with using.

My question is, is there any technical reason that this couldn't be supported? Basically, were the committee to allow this with typedef, would there be any implementation problems? For example, would it conflict with something else or cause some weird parsing issue?

For any cases I've been able to come up with, it should be fine, but I'm no expert which is why I'm asking here.

Research I've done, that doesn't answer the question:

CoffeeTableEspresso
  • 2,614
  • 1
  • 12
  • 30
  • 1
    I don't think there is any reason why this couldn't be done. My understanding is that `typedef` has been effectively replaced by `using` and it doesn't make sense to backport features to language constructs that have been supplanted -- it adds complexity to the language for no benefit. – cdhowie Jul 30 '20 at 00:35
  • @cdhowie that is the impression I've gotten as well, but haven't been able to find a proper source to back it up, hence this question... – CoffeeTableEspresso Jul 30 '20 at 00:48

0 Answers0