What you suggest was actually proposed back in 2002 in document N1406 by Herb Sutter. It would allow, for example, to write:
template<typename T> typedef X<T,int> Xi;
This was later revised in N1449 by Gabriel Dos Reis and Mat Marcus. They adopt the using
syntax, and note the following:
Note that we specifically avoid the term “typedef template” and introduce the new syntax involving the pair “using” and “=” to help avoid confusion: we are not defining any types here, we are introducing a synonym (i.e. alias) for an abstraction of a type-id (i.e. type expression) involving template parameters.
They also state:
Two straw polls were taken regarding syntax. A strong majority voted to avoid the typedef template syntax, in favor of the “=” syntax. A second vote indicated strong preference for the “using” keyword as opposed to a word like “alias” or the absence of any keyword as in the draft version of this proposal. The motivation for using any keyword at all stemmed partly from the desire to use a syntax that might be compatible with the non-template aliasing direction briefly outlined above.
This syntax was then adopted in the final proposal N2258 by Gabriel Dos Reis and Bjarne Stroustrup.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…