Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


2293. Requirements forsimple-template-id used as aclass-name

Section:Clause 11  [class]    Status:CD5    Submitter:CWG    Date:2016-06-22

[Accepted as a DR at the June, 2018 (Rapperswil) meeting.]

There is currently no requirement that asimple-template-idused as aclass-name (Clause 11 [class] paragraph 1) musthave template arguments for every template parameter that does not havea default template argument.

Proposed resolution (March, 2018):

  1. Change _N4868_.6.4.1 [basic.scope.declarative] paragraph 1 as follows:

  2. Every name is introduced in some portion of program text called adeclarative region, which is the largest part of the program in which thatname isvalidvalid, that is, in which thatname may be used as an unqualified name to refer to the same entity. Ingeneral...
  3. Add the following as a new paragraph after 13.3 [temp.names] paragraph 7:

  4. Atemplate-id that names an alias template specialization isatype-name.

    Atemplate-id isvalid if

    Asimple-template-id shall be valid unless it names afunction template specialization(13.10.3 [temp.deduct]). [Example:

      template<class T, T::type n = 0> class X;  struct S {    using type = int;  };  using T1 = X<S, int, int>;  // error: too many arguments  using T2 = X<>;             // error: no default argument for first template parameter  using T3 = X<1>;            // error: value1 does not match type-parameter  using T4 = X<int>;          // error: substitution failure for second template parameter  using T5 = X<S>;            // OK

    end example]

  5. Change 13.10.3 [temp.deduct] paragraph 2 as follows, convertingfrom bullets to running text:

  6. When an explicit template argument list is specified, if thetemplatearguments are not compatible with the template parameter list or do notresult in a valid function type as described belowgiventemplate-id is invalid (13.3 [temp.names]), typededuction fails.Specifically, the following steps are performed whenevaluating an explicitly specified template argument list with respect to agiven function template:




[8]ページ先頭

©2009-2026 Movatter.jp