Title
Constraints and template aliases
Status
concepts
Section
13.7.8 [temp.alias]
Submitter
James Widman

Created on 2009-04-01.00:00:00 last changed 187 months ago

Messages

Date: 2009-11-08.00:00:00

The relationship of requirements with template aliases is not clear in the current wording. For example, something like

    auto concept C{};

    template <class T> struct A{};

    template <C T>  using B = A<T>;

is presumably allowed by the current wording of 13.7.8 [temp.alias] but, unless a good use case is presented, should probably be prohibited.

On the other hand, _N2914_.14.11 [temp.constrained] paragraph 5,

Within a constrained context, a program shall not require a template specialization of an unconstrained template for which the template arguments of the specialization depend on a template parameter.

might be considered to forbid an example like

    template <C T> struct X {};

    template <class T> using Y = X<T>;

    template <std::VariableType T>
    void f(Y<T>); // Error?

although it should probably be allowed. (Note, however, that 13.7.8 [temp.alias] paragraph 2,

When a template-id refers to the specialization of a template alias, it is equivalent to the associated type obtained by substitution of its template-arguments for the template-parameters in the type-id of the template alias.

could be viewed as allowing this example, depending on how the word “equivalent” is understood.)

The text should be amended to clarify the resolution of these questions. (See also issue 848.)

History
Date User Action Args
2009-08-03 00:00:00adminsetstatus: open -> concepts
2009-04-01 00:00:00admincreate