Changeset 44708


Ignore:
Timestamp:
Apr 22, 2008, 3:24:54 AM (10 years ago)
Author:
Douglas Gregor
Message:

Lots of tweaks from my review of the concepts wording

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/committee/concepts/wording/wording.tex

    r44519 r44708  
    7777\section*{Changes from N2501}
    7878\begin{itemize}
    79 \item Incorporate wording to description ``option \#2'', corresponding
     79\item Incorporate wording for ``option \#2'', corresponding
    8080  to the ``Eliminate Forwarding Functions'' option described in
    8181  N2576~\cite{gregor08:soundness}.
     
    8989\item Add text to cope with inheriting constructors
    9090  (\ref{class.inhctor}).
     91\item Update handling of deleted special member functions to cope with
     92  unrestricted unions (clause~\ref{special}).
    9193\item Clarify that a class template partial specialization of a
    9294  constrained class template is not necessarily a constrained template
     
    99101  lookup. As part of this change, this text has moved to the template
    100102  argument deduction section (\ref{temp.deduct}).
     103\item Large cleanup to the wording for satisfying associated functions
     104  (\ref{concept.map.fct}).
    101105\end{itemize}
    102106
     
    624628has the typedef name for linkage purposes (\ref{dcl.typedef}), has external
    625629linkage if the name of the class has external linkage.
    626 \addedConcepts{An associated function definition
     630\removedCCC{An associated function definition
    627631  (\mbox{\ref{concept.map.fct}}) has external linkage.}
    628632\end{paras}
     
    796800\pnum
    797801\index{statement}%
    798 Except as indicated, statements are executed in sequence.
     802\textcolor{black}{}Except as indicated, statements are executed in sequence.
    799803\index{sequence!statement}%
    800804
     
    820824\addedConcepts{In a constrained context
    821825  (\mbox{\ref{temp.constrained}}), a late-checked block treats the
    822   enclosed statements as if they were not in a constrained
    823   context. Outside of a constrained context, the late-checked block
     826  enclosed statements as if they were}
     827\changedCCC{not in a constrained}{in an unconstrained}
     828\addedConcepts{context. Outside of a constrained context, the late-checked block
    824829  has no effect. \mbox{\enternote} in a late-checked block, template
    825830  parameters do not behave as if they were replaced with their
     
    10681073brought into scope.}
    10691074
     1075\pnum
    10701076\addedConcepts{\mbox{\enternote}
    10711077a \mbox{\emph{using-directive}} for a namespace brings the concept
     
    11241130  used to form a type ``reference to \mbox{\techterm{cv} \tcode{T}}''
    11251131  if the
    1126   template has a concept requirement \mbox{\tcode{ReferentType<T>}}.}
     1132  template has a concept requirement}
     1133\changedCCC{\mbox{\tcode{ReferentType<T>}}}{\mbox{\tcode{VariableType<T>}}}
     1134\addedCC{\mbox{\enternote} Due to reference collapsing
     1135  (\mbox{\ref{temp.arg.type}}), it is valid to form a reference to a
     1136  reference type. Hence, the requirement for forming a reference type
     1137  is \mbox{\tcode{VariableType<T>}} rather than
     1138  \mbox{\tcode{ReferentType<T>}} \mbox{\exitnote}}
     1139\addedConcepts{.}
    11271140
    11281141\rSec2[dcl.mptr]{Pointers to members}
     
    12991312If there is no user-declared constructor for class
    13001313\tcode{X},
    1301 a default constructor is implicitly declared.
     1314a constructor having no parameters is implicitly declared.
    13021315An implicitly-declared default constructor is an
    13031316\tcode{inline}
    13041317\tcode{public}
    13051318member of its class.
     1319\removedCC{For a union-like class that has a variant member with a
     1320  non-trivial default constructor, an implicitly-declared default
     1321  constructor is defined as deleted (\mbox{\ref{dcl.fct.def}}).}
    13061322A default constructor is
    13071323\techterm{trivial}\
     
    13211337  \mbox{\tcode{X}} is deleted if:}
    13221338\begin{itemize}
     1339\additemCC{\mbox{\tcode{X}} is a union-like class that has a variant
     1340  member with a non-trivial default constructor,}
    13231341\additemConcepts{any non-static data member is of reference type,}
    13241342\additemConcepts{any non-static data member of const-qualified type (or array
    1325 thereof) does not have a user-provided default constructor; or}
     1343thereof) does not have a user-provided default constructor, or}
    13261344\additemConcepts{any non-static data member or direct or virtual base class has
    13271345class type \mbox{\tcode{M}} (or array thereof) and \mbox{\tcode{M}}
     
    14591477\tcode{public}
    14601478member of its class.
     1479\removedCC{If the class is a union-like class that has a variant
     1480  member with a non-trivial destructor, an implicitly-declared
     1481  destructor is defined as delected (\mbox{\ref{dcl.fct.def}}).}
    14611482A destructor is
    14621483\techterm{trivial}\
     
    14731494  \mbox{\tcode{X}} is deleted if:}
    14741495\begin{itemize}
     1496\additemCC{\mbox{\tcode{X}} is a union-like class that has a variant
     1497  member with a non-trivial destructor,}
    14751498\additemConcepts{any of the non-static data members has class type
    14761499  \mbox{\tcode{M}} (or array thereof) and
     
    14821505\end{itemize}
    14831506
     1507\setcounter{Paras}{4}
     1508\pnum
     1509An implicitly-declared destructor is
     1510\techterm{implicitly}\
     1511\techterm{defined}\
     1512when it is used to destroy an object of its class type (\ref{basic.stc}).
     1513A program is ill-formed
     1514\changedCC{if the class for which a destructor is implicitly
     1515defined has:}{if the implicitly-defined constructor is explicitly
     1516defaulted, but the corresponding implicit declaration would have been deleted.}
     1517
     1518\begin{itemize}
     1519\item
     1520\removedCC{a non-static data member of class type (or array thereof) with an
     1521inaccessible destructor, or}
     1522\item
     1523\removedCC{a base class with an inaccessible destructor.}
     1524\end{itemize}
     1525
     1526Before the implicitly-declared destructor for a class is implicitly defined,
     1527all the implicitly-declared destructors for its base classes and
     1528its non-static data members shall have been implicitly defined.
     1529\enternote\
     1530an implicitly-declared destructor has an
     1531\techterm{exception-specification}~(\ref{except.spec}).
     1532\exitnote\
     1533
    14841534\setcounter{section}{7}
    14851535\rSec1[class.copy]{Copying class objects}
     1536
     1537\setcounter{Paras}{3}
     1538\pnum
     1539\index{copy~constructor!implicitly-declared}%
     1540If the class definition does not explicitly declare a copy constructor,
     1541one is declared
     1542\techterm{implicitly}. \removedCC{If the class is a union-like class
     1543  that has a variant member with a non-trivial copy constructor, an
     1544  implicitly-declared copy constructor is defined as deleted
     1545  (\mbox{\ref{dcl.fct.def}}).}
     1546Thus, for the class definition
     1547
     1548\begin{codeblock}
     1549struct X {
     1550        X(const X&, int);
     1551};
     1552\end{codeblock}
     1553
     1554a copy constructor is implicitly-declared.
     1555If the user-declared constructor is later defined as
     1556
     1557\begin{codeblock}
     1558X::X(const X& x, int i =0) { /* ... */ }
     1559\end{codeblock}
     1560
     1561then any use of
     1562\tcode{X}'s
     1563copy constructor is ill-formed because of the ambiguity;
     1564no diagnostic is required.
    14861565
    14871566\setcounter{Paras}{4}
     
    15461625  \mbox{\tcode{X}} is deleted if \mbox{\tcode{X}} has:}
    15471626\begin{itemize}
     1627\additemCC{a variant member with a non-trivial copy constructor and
     1628  \mbox{\tcode{X}} is a union-like class,}
    15481629\additemConcepts{a non-static data member of class type
    15491630  \mbox{\tcode{M}} (or array thereof) that cannot be copied because
     
    16061687one is declared
    16071688\techterm{implicitly}.
     1689\removedCC{If the class is
     1690a union-like class that has a variant member with a non-trivial copy
     1691assignment operator, an implicitly-declared copy 
     1692assignment operator is defined as deleted (\mbox{\ref{dcl.fct.def}}).}
    16081693The implicitly-declared copy assignment operator for a class
    16091694\tcode{X}
     
    16741759  class \mbox{\tcode{X}} is deleted if \mbox{\tcode{X}} has:}
    16751760\begin{itemize}
     1761\additemCC{a variant member with a non-trivial copy constructor and
     1762  \mbox{\tcode{X}} is a union-like class,}
    16761763\additemConcepts{a non-static data member of \mbox{\tcode{const}} non-class
    16771764  type (or array thereof), or}
     
    18781965\pnum
    18791966\index{function~call~operator!overloaded}%
    1880 \addedConcepts{If declared in a concept,
    1881 \mbox{\tcode{operator()}}
     1967\addedConcepts{If declared in a concept}
     1968\addedCC{or concept map}\addedConcepts{, \mbox{\tcode{operator()}}
    18821969shall be a non-member associated function with one or more parameters.}
    18831970\addedConcepts{It implements the function call syntax}
     
    19392026
    19402027\pnum
    1941 \addedConcepts{If declared in a concept,
    1942 \mbox{\tcode{operator[]}}
     2028\addedConcepts{If declared in a concept}
     2029\addedCC{or concept map}\addedConcepts{, \mbox{\tcode{operator[]}}
    19432030shall be a non-member associated function with exactly two parameters.
    19442031It implements the subscripting syntax}
     
    19922079\pnum
    19932080\index{member~access~~operator!overloaded}%
    1994 \addedConcepts{If declared in a concept,
     2081\addedConcepts{If declared in a concept}
     2082\addedCC{or concept map}\addedConcepts{,
    19952083\mbox{\tcode{operator->}}
    19962084shall be a non member associated function taking exactly one parameter.
     
    20162104exists and if the operator is selected as the best match function by
    20172105the overload resolution mechanism (\mbox{\ref{over.match}}).}
     2106
     2107\setcounter{section}{5}
     2108\rSec1[over.built]{Built-in operators}
     2109
     2110\pnum
     2111The candidate operator functions that represent the built-in operators
     2112defined in clause \ref{expr} are specified in this subclause.
     2113These candidate
     2114functions participate in the operator overload resolution process as
     2115described in \ref{over.match.oper} and are used for no other purpose.
     2116\addedCC{No built-in operators are defined for archetypes
     2117  (\mbox{\ref{temp.archetype}}), even though
     2118  template requirements naming compiler-supported concepts
     2119  (\mbox{\ref{concept.support}}) can classify archetypes as non-class
     2120  types.}
     2121\enternote\
     2122because built-in operators take only operands with non-class type,
     2123and operator overload resolution occurs only when an operand expression
     2124originally has class or enumeration type,
     2125operator overload resolution can resolve to a built-in operator only
     2126when an operand has a class type that has a user-defined conversion to
     2127a non-class type appropriate for the operator, or when an operand has
     2128an enumeration type that can be converted to a type appropriate
     2129for the operator.
     2130Also note that some of the candidate operator functions given in this subclause are
     2131more permissive than the built-in operators themselves.
     2132As
     2133described in \ref{over.match.oper}, after a built-in operator is selected
     2134by overload resolution the expression is subject to the requirements for
     2135the built-in operator given in clause \ref{expr}, and therefore to any
     2136additional semantic constraints given there.
     2137If there is a user-written
     2138candidate with the same name and parameter types as a built-in
     2139candidate operator function, the built-in operator function
     2140is hidden and is not included in the set of candidate functions.
     2141\exitnote\
    20182142
    20192143\rSec0[temp]{Templates}
     
    25072631  template requirements}, and have return types
    25082632  and parameter
    2509 lists that are equivalent \textcolor{black}{}using the rules described above to compare
     2633lists that are equivalent using the rules described above to compare
    25102634expressions involving
    25112635template parameters.
     
    25152639if they are equivalent except that one or more
    25162640expressions
    2517 that involve template parameters in the return types and parameter
    2518 lists are functionally equivalent using the rules described above to
     2641that involve template parameters in the return types\addedCC{,} \removedCC{and} parameter
     2642lists\addedCC{, and template requirements (if any)} are functionally equivalent using the rules described above to
    25192643compare expressions involving
    25202644template parameters.
     
    25792703template<class T> void h(A<T>&);
    25802704void m() {
    2581   @\textcolor{black}{const}@ int *p;
     2705  int *p;
    25822706  f(p);                   // \tcode{f(const T*)}\ is more specialized than \tcode{f(T)}\ or \tcode{f(T*)}
    25832707  float x;
    25842708  g(x);                   // Ambiguous: \tcode{g(T)}\ or \tcode{g(T\&)}
    2585   A<int> z;
     2709  @\textcolor{black}{}@A<int> z;
    25862710  h(z);                   // overload resolution selects \tcode{h(A<T>\&)}
    25872711  const A<int> z2;
     
    25962720  partial ordering is based on those template requirements. Similarly,
    25972721  a constrained template is more specialized than an unconstrained
    2598   template because it has more strict requirements. \mbox{\exitnote}}
     2722  template because it has more stringent requirements. \mbox{\exitnote}}
    25992723\enterexample\
    26002724\begin{codeblock}
     
    26552779\pnum
    26562780\addedConcepts{A concept map template is a constrained template (\mbox{\ref{temp.constrained}})
    2657 \mbox{\enternote} a concept map template may be a constrained template even
     2781\mbox{\enternote} a concept map template is a constrained template even
    26582782if it does not have template requirements.  \mbox{\exitnote}}
    26592783
     
    27792903template<Stack X>
    27802904void f(X& x) {
    2781   X::value_type& t = top(x);
     2905  @\textcolor{addclr}{}@X::value_type& t = top(x);
    27822906}
    27832907
     
    31253249  (\mbox{\ref{temp.req.sat}}) does not find a}
    31263250\addedConcepts{concept map corresponding to that
    3127   concept instance (\mbox{\ref{concept.map}}).}
     3251  concept instance.}
    31283252
    31293253\additemConcepts{Attempting to use a class or function template with
    3130   template arguments that do not satisfy the template
     3254  template arguments that}
     3255\changedCCC{do not}{are not used to}
     3256\addedConcepts{satisfy the template
    31313257  requirements. \mbox{\enterexample}}
    31323258\color{addclr}
     
    31363262template<typename T> requires C<T> class X { /* ... */ };
    31373263
    3138 template<typename T> int f(X<T>*);
    3139 int i0 = f<int>(0);
     3264template<typename T> int f(X<T>*); // \#1
     3265template<typename> int f(...); // \#2
     3266int i0 = f<int>(0); // okay: calls \#2
    31403267\end{codeblock}
    31413268\color{black}
     
    31523279multiple times in the requirements of the template,}
    31533280\changedCCC{the program is ill-formed}{and}
    3154 \addedConcepts{if the concept maps used to satisfy the multiple
     3281\addedConcepts{if the concept maps (\mbox{\ref{concept.map}}) used to satisfy the multiple
    31553282occurrences of the concept requirement are not the same concept map}
    31563283\addedCC{or are different from the concept map that would be
     
    32403367the scope in which it is declared immediately after the
    32413368\mbox{\techterm{concept-name}} is seen. A concept is considered defined after
    3242 the closing brace of its \\mbox{techterm{concept-body}}. A \mbox{\techterm{full
     3369the closing brace of its \mbox{\techterm{concept-body}}. A \mbox{\techterm{full
    32433370  concept name}} is an identifier that is treated as if it were
    32443371composed of the concept name and the sequence of its enclosing namespaces.}
     
    32483375
    32493376\pnum
    3250 \addedConcepts{A concept that starts with \mbox{\tcode{auto}} defines an \mbox{\techterm{implicit concept}}
    3251 (\mbox{\ref{concept.map.implicit}}), otherwise it defines an
     3377\addedConcepts{A \mbox{\techterm{concept-definition}} that starts with \mbox{\tcode{auto}} defines an \mbox{\techterm{implicit concept}}, otherwise it defines an
    32523378\mbox{\techterm{explicit concept}}.}
    32533379
     
    32803406concept shall refer to only one of: an associated type, an associated
    32813407template, an axiom, the name of the concept, or one or more associated
    3282 functions that have been overloaded (\mbox{\ref{over}}).}
     3408functions that have been overloaded (clause~\mbox{\ref{over}}).}
    32833409
    32843410\rSec3[concept.fct]{Associated functions}
     
    32863412\pnum
    32873413\addedConcepts{Associated functions describe functions, member functions, or
    3288 operators that specify the functional behavior of the concept
     3414operators}
     3415\addedCC{(including templates thereof)}
     3416\addedConcepts{that specify the functional behavior of the concept
    32893417arguments and associated types and templates (\mbox{\ref{concept.assoc}}). A
    32903418concept map
    32913419(\mbox{\ref{concept.map}}) for a given concept must}\changedCCC{provide, either
    3292 implicitly (\mbox{\ref{concept.map.implicit}}) or explicitly
     3420implicitly (\mbox{\ref{concept.map}}) or explicitly
    32933421(\mbox{\ref{concept.map.fct}}), definitions for}{satisfy}
    32943422\addedConcepts{each associated
     
    33533481  X::~X();
    33543482  bool X::empty() const;
     3483  static size_t X::max_size();
    33553484}
    33563485\end{codeblock}
     
    34073536\addedConcepts{Associated functions may have a default implementation. This
    34083537implementation will be instantiated when} \changedCCC{implicit definition of an
    3409 implementation (\mbox{\ref{concept.map.implicit}}) for}{needed to
     3538implementation (\mbox{\ref{concept.map}}) for}{needed to
    34103539satisfy}
    34113540\addedConcepts{the associated function}
     
    34413570concept Callable1<typename F, typename T1> {
    34423571  typename result_type;
    3443   result_type operator()(F, T1);
     3572  result_type operator()(F&&, T1);
    34443573}
    34453574\end{codeblock}\addedConcepts{\mbox{\exitexample}}
     
    36063735\addedConcepts{Axioms can state conditional semantics using \mbox{\tcode{if}}
    36073736statements. The \mbox{\techterm{expression}} is contextually
    3608   converted to bool (clause~\mbox{\ref{conv}}). When the condition
     3737  converted to \mbox{\tcode{bool}} (clause~\mbox{\ref{conv}}). When the condition
    36093738can be proven true, and the
    36103739\mbox{\textit{expression-statement}} states the equality of two expressions,
     
    36813810explicitly (\mbox{\ref{concept.map}}), instantiated from a concept map
    36823811template (\mbox{\ref{temp.concept.map}}), or generated implicitly
    3683 (\mbox{\ref{concept.map.implicit}}).}
     3812(\mbox{\ref{concept.map}}).}
    36843813%
    36853814\addedConcepts{The concept map is inserted into the scope in
     
    37113840
    37123841f(student_record()); // okay, have concept_map EqualityComparable<student_record>
    3713 \end{codeblock}
    3714 \addedConcepts{\mbox{\exitexample}}
    3715 
    3716 \pnum
    3717 \addedConcepts{A concept map for an implicit concept is implicitly defined when it is
    3718 needed} \addedCC{to satisfy a requirement (\mbox{\ref{temp.req.sat}})
    3719 or provide a definition for a specific concept instance}.
    3720 \addedConcepts{The implicitly-defined concept map is defined in the
    3721   namespace of the concept. \mbox{\enterexample}}
    3722 \begin{codeblock}
    3723 auto concept Addable<typename T> {
    3724   T::T(const T&);
    3725   T operator+(T, T);
    3726 }
    3727 
    3728 template<typename T>
    3729 requires Addable<T>
    3730 T add(T x, T y) {
    3731   return x + y;
    3732 }
    3733 
    3734 int f(int x, int y) {
    3735   return add(x, y); // okay: concept map Addable<int> implicitly defined
    3736 }
    37373842\end{codeblock}
    37383843\addedConcepts{\mbox{\exitexample}}
     
    37953900} // error: no concept_map SignedIntegral<long> if ptrdiff_t is not long
    37963901\end{codeblock}
     3902\addedConcepts{\mbox{\exitexample}}
     3903
     3904\pnum
     3905\addedConcepts{A concept map for an implicit concept is implicitly defined when it is
     3906needed} \addedCC{by concept map lookup (\mbox{\ref{temp.req.sat}})}\addedConcepts{.}
     3907\addedCC{If any requirement of the concept or its refinements is not
     3908  satisfied by the implicitly-defined concept map, concept map lookup fails.}
     3909\addedConcepts{The implicitly-defined concept map is defined in the
     3910  namespace of the concept. \mbox{\enterexample}}
     3911\begin{codeblock}
     3912auto concept Addable<typename T> {
     3913  T::T(const T&);
     3914  T operator+(T, T);
     3915}
     3916
     3917template<typename T>
     3918requires Addable<T>
     3919T add(T x, T y) {
     3920  return x + y;
     3921}
     3922
     3923int f(int x, int y) {
     3924  return add(x, y); // okay: concept map Addable<int> implicitly defined
     3925}
     3926\end{codeblock}
     3927\addedConcepts{\mbox{\exitexample}}
     3928
     3929\pnum
     3930\addedConcepts{\mbox{\enternote} Failure to implicitly define a
     3931concept map does not imply that the program is ill-formed. \mbox{\exitnote}\
     3932\mbox{\enterexample}}
     3933\begin{codeblock}
     3934auto concept F<typename T> {
     3935  void f(T);
     3936}
     3937
     3938auto concept G<typename T> {
     3939  void g(T);
     3940}
     3941
     3942template<typename T> requires F<T> void h(T); // \#1
     3943template<typename T> requires G<T> void h(T); // \#2
     3944
     3945struct X { };
     3946void g(X);
     3947
     3948void func(X x) {
     3949  h(x); // okay: implicit concept map F<X> fails, causing template argument deduction to fail for \#1; calls \#2
     3950}
     3951\end{codeblock}
    37973952\addedConcepts{\mbox{\exitexample}}
    37983953
     
    38874042
    38884043\addedCC{For an associated member function (or member function
    3889   template) in a type \mbox{\tcode{X}} (after substitution the concept
    3890   map's template arguments into the associated member function or
     4044  template) in a type \mbox{\tcode{X}} (after substitution of the concept
     4045  map arguments into the associated member function or
    38914046  member function template), let \mbox{\tcode{x}} be an object of type
    38924047  \mbox{$cv$ \tcode{X}}, where \mbox{$cv$} are the
     
    39074062    to the definitions of \mbox{\tcode{f}} in the concept map,}
    39084063
    3909 \additemCC{if the concept map contains one or more non-static member function
     4064\additemCC{if \mbox{\tcode{f}} is a non-static associated member
     4065  function and the concept map contains one or more member function
    39104066    or member function template definitions in the type
    39114067    \mbox{\tcode{X}} and with the same name as \mbox{\tcode{f}},
    39124068    \mbox{\tcode{E}} is \mbox{\tcode{x.f(parm1$'$, parm2$'$,
    3913         ..., parm$N'$)}}, where name lookup of \mbox{\tcode{x.f}} refers
     4069        ...,}} \mbox{\tcode{parm$N'$)}}, where name lookup of \mbox{\tcode{x.f}} refers
    39144070    to the definitions of \mbox{\tcode{X::f}} in the concept map,}
    39154071
    3916 \additemCC{if the concept map contains one or more static member function
     4072\additemCC{if \mbox{\tcode{f}} is a static associated member function
     4073  and the concept map contains one or more member function
    39174074    or member function template definitions in the type
    39184075    \mbox{\tcode{X}} and with the same name as \mbox{\tcode{f}},
     
    41064263    };
    41074264};
    4108 \end{codeblock}
    4109 \addedConcepts{\mbox{\exitexample}}
    4110 
    4111 \rSec3[concept.map.implicit]{Implicit definitions}
    4112 
    4113 \pnum
    4114 \addedConcepts{Any of the requirements of a concept and its refined concepts
    4115 (\mbox{\ref{concept.refine}}) that are not
    4116 satisfied by the definitions in the body of a concept map
    4117 (\mbox{\ref{concept.map.fct}}, \mbox{\ref{concept.map.assoc}}) are
    4118 \mbox{\techterm{unsatisfied requirements}}.}
    4119 
    4120 \pnum
    4121 \addedConcepts{Definitions for unsatisfied requirements in a concept map are
    4122 implicitly generated from the requirements and their default values as
    4123 follows. If any unsatisfied requirement is not
    4124 matched by this process, the concept map is ill-formed.}
    4125 
    4126 \pnum
    4127 \addedConcepts{The implicit definition of a concept map involves the implicit
    4128 definition of concept map members for each associated non-member function
    4129 (\mbox{\ref{concept.fct}}) and associated type or template (\mbox{\ref{concept.assoc}})
    4130 requirement, described below. If the implicit definition of a concept
    4131 map member would produce an invalid definition, or if any of the
    4132 requirements of the concept would not be satisfied by the
    4133 implicitly-defined concept map (\mbox{\ref{concept.map}}), the implicit definition of
    4134 the concept map fails \mbox{\enternote} failure to implicitly define a
    4135 concept map does not imply that the program is ill-formed. \mbox{\exitnote}\
    4136 \mbox{\enterexample}}
    4137 \begin{codeblock}
    4138 auto concept F<typename T> {
    4139   void f(T);
    4140 }
    4141 
    4142 auto concept G<typename T> {
    4143   void g(T);
    4144 }
    4145 
    4146 template<typename T> requires F<T> void h(T); // \#1
    4147 template<typename T> requires G<T> void h(T); // \#2
    4148 
    4149 struct X { };
    4150 void g(X);
    4151 
    4152 void func(X x) {
    4153   h(x); // okay: implicit concept map F<X> fails, causing template argument deduction to fail for \#1; calls \#2
    4154 }
    41554265\end{codeblock}
    41564266\addedConcepts{\mbox{\exitexample}}
     
    41874297void g(int* x) {
    41884298  f(x); // okay: Dereferenceable<int*> implicitly defined
    4189                   // implicitly-defined Dereferenceable<int*>::operator* calls built-in * for integer pointers
    4190                   // implicitly-defined Dereferenceable<int*>::value_type is int
     4299        // implicitly-defined Dereferenceable<int*>::operator* calls built-in * for integer pointers
     4300        // implicitly-defined Dereferenceable<int*>::value_type is int
    41914301}
    41924302\end{codeblock}
     
    44784588only for certain refinements of the concept corresponding to the
    44794589concept map template. A concept map template for a particular refined
    4480 concept is defined if all of the template parameters of the refining
     4590concept is defined}
     4591\addedCC{in the namespace of the concept map}
     4592\addedConcepts{if all of the template parameters of the refining
    44814593concept map template can be deduced from the
    44824594\mbox{\techterm{template-argument-list}} of
     
    44854597(\mbox{\ref{temp.deduct.type}}). If template argument deduction fails, then a
    44864598concept map template corresponding to the refined concept shall
    4487 have been defined.
     4599have been defined}
     4600\addedCC{in the namespace of the concept map}\addedConcepts{.
    44884601\mbox{\enterexample}}
    44894602\begin{codeblock}
     
    45904703  the template requirements of the constrained template
    45914704  (\mbox{\ref{basic.scope.req}}). \mbox{\enternote} Within a constrained
    4592   context, template parameters behave as if aliased their
     4705  context, template parameters behave as if aliased}
     4706\addedCC{to}
     4707\addedConcepts{their
    45934708  corresponding archetypes
    45944709  (\mbox{\ref{temp.archetype}}) so there are no dependent types
     
    45974712  Instantiation in constrained contexts (\mbox{\ref{temp.constrained.inst}})
    45984713  still substitutes types, templates and values for template
    4599   parameters, but the substitution does not require additional name
    4600   lookup (\mbox{\ref{basic.lookup}}). \mbox{\exitnote} A constrained
     4714  parameters}\removedCCC{, but the substitution does not require additional name
     4715  lookup (\mbox{\ref{basic.lookup}})}\addedConcepts{. \mbox{\exitnote} A constrained
    46014716  context is:}
    46024717\begin{itemize}
    46034718\additemConcepts{the body of a constrained function template,}
    46044719\additemConcepts{the \mbox{\techterm{expression}} in a
    4605   \mbox{\tcode{decltype}} type or \mbox{\tcode{sizeof}} expression
     4720  \mbox{\tcode{decltype}} type or \mbox{\tcode{sizeof}}}
     4721\addedCC{or \mbox{\tcode{alignof}}} \addedConcepts{expression
    46064722  that occurs within the signature of a constrained function template,}
    46074723\additemConcepts{the \mbox{\techterm{base-clause}} (if any) of a constrained
     
    46194735  context, several constructs provide unconstrained contexts:}
    46204736\begin{itemize}
    4621   \additemConcepts{a late-checked block (\mbox{\ref{stmt.late}}) indicates a
    4622     compound statement that is an unconstrained context,}
     4737  \additemConcepts{a late-checked block (\mbox{\ref{stmt.late}})}
     4738  \removedCCC{indicates a
     4739    compound statement that is an unconstrained context}\addedConcepts{,}
    46234740  \additemConcepts{a default template argument in a
    4624     \mbox{\techterm{template-parameter}} is an unconstrained context,}
     4741    \mbox{\techterm{template-parameter}}} \removedCCC{is an
     4742    unconstrained context}\addedConcepts{,}
    46254743  \additemConcepts{a default argument in a
    46264744    \mbox{\techterm{parameter-declaration}}}\addedCC{, unless that
    46274745    default argument occurs within a local class
    4628     (\mbox{\ref{class.local}}).}
    4629   \additemCC{the \mbox{\techterm{requires-clause}}, \mbox{\techterm{type-specifier}}, and \mbox{\techterm{declarator}} of a constrained member (\mbox{\ref{class.mem}}) are unconstrained contexts, and}
    4630   \additemCC{a member template of a constrained template is an
    4631     unconstrained context (\mbox{\ref{temp.mem}}). \mbox{\enternote}
     4746    (\mbox{\ref{class.local}}),}
     4747  \additemCC{the \mbox{\techterm{requires-clause}},
     4748    \mbox{\techterm{type-specifier}}, and \mbox{\techterm{declarator}}
     4749    of a constrained member (\mbox{\ref{class.mem}}), and}
     4750  \additemCC{a member template of a constrained template
     4751    (\mbox{\ref{temp.mem}}). \mbox{\enternote}
    46324752    The member template itself will still be a constrained template,
    46334753    and its body will be a constrained context. \mbox{\exitnote}}
     
    46594779\pnum
    46604780\addedConcepts{A template has \mbox{\techterm{template requirements}} if it contains a
    4661 \mbox{\techterm{requires-clause}} or any of its template parameters were
     4781\mbox{\techterm{requires-clause}} or any of its template parameters is
    46624782specified using the simple form of requirements
    46634783(\mbox{\ref{temp.param}}). Template requirements state the conditions under
     
    47914911    explicitly (\mbox{\ref{concept.map}}), instantiated from a concept
    47924912    map template (\mbox{\ref{temp.concept.map}}), or defined
    4793     implicitly (\mbox{\ref{concept.map.implicit}}).}
     4913    implicitly (\mbox{\ref{concept.map}}).}
    47944914\addedConcepts{\mbox{\enterexample}}
    47954915\begin{codeblock}
     
    48784998  \mbox{\tcode{S}} in \mbox{\tcode{Q}}, concept map lookup proceeds to
    48794999  the next set in \mbox{\tcode{Q}}. If partial ordering of concept
    4880     map templates results in an ambiguity, concept map lookup halts and
    4881     the requirement is not satisfied.}
     5000    map templates results in an ambiguity, concept map lookup returns
     5001    no result.}
    48825002
    48835003\pnum
     
    49025022
    49035023  \additemCC{If a concept map for \mbox{\tcode{I}} can be implicitly
    4904     defined (\mbox{\ref{concept.map.implicit}}), \mbox{\tcode{S}}
     5024    defined (\mbox{\ref{concept.map}}), \mbox{\tcode{S}}
    49055025    contains the implicitly-defined concept map for
    49065026    \mbox{\tcode{I}}. Otherwise, \mbox{\tcode{S}} is empty.}
     
    49485068
    49495069  \additemCC{If a concept map for \mbox{\tcode{I}} can be implicitly
    4950     defined (\mbox{\ref{concept.map.implicit}}), \mbox{\tcode{S}}
     5070    defined (\mbox{\ref{concept.map}}), \mbox{\tcode{S}}
    49515071    contains the implicitly-defined concept map for
    49525072    \mbox{\tcode{I}}. Otherwise, \mbox{\tcode{S}} is empty.}
     
    50225142\additemConcepts{the requirements of a constrained template (including
    50235143  implied requirements),}
    5024 \additemConcepts{the associated requirements of a concept, and}
     5144\additemConcepts{the associated requirements} \addedCC{and
     5145  refinements}
     5146\addedConcepts{of a concept, and}
    50255147\additemConcepts{the type of an associated function requirement.}
    50265148\end{itemize}
     
    51575279\item \addedConcepts{an associated type (\mbox{\ref{concept.assoc}}), or}
    51585280\item \addedConcepts{a class template specialization involving one or more
    5159   archetypes}
     5281  archetypes.}
    51605282\end{itemize}
    51615283
     
    51735295
    51745296\pnum
    5175 If two types, \tcode{T1} and \tcode{T2}, both alias archetypes and are
     5297\addedConcepts{If two types, \mbox{\tcode{T1}} and \mbox{\tcode{T2}},
     5298  both alias archetypes and are
    51765299the same (e.g., due to one or more same-type requirements
    5177 (\ref{temp.req})), then \tcode{T1} and \tcode{T2} alias the same
    5178 archetype \tcode{T$'$}. \addedConcepts{\mbox{\enternote} there is no
     5300(\mbox{\ref{temp.req}})), then \mbox{\tcode{T1}} and \mbox{\tcode{T2}}
     5301alias the same
     5302archetype \mbox{\tcode{T$'$}}. \mbox{\enternote} there is no
    51795303  mechanism to specify the relationships between different value
    51805304  archetypes, because such a mechanism would introduce the need for equational
     
    53405464template with its template arguments (which involve archetypes).
    53415465The template shall not be an unconstrained
    5342 template. \mbox{\enternote} partial ordering of class
     5466template. \mbox{\enternote} Partial ordering of class
    53435467template partial specializations (\mbox{\ref{temp.class.order}}) will depend
    53445468on the properties of the archetypes, as defined by the requirements
     
    53715495\addedConcepts{\mbox{\exitexample}}
    53725496
    5373 \addedConcepts{\mbox{\enternote} class template specializations for which
     5497\addedConcepts{\mbox{\enternote} Class template specializations for which
    53745498  template requirements are specified behave as normal
    53755499  archetypes. \mbox{\exitnote} \mbox{\enterexample}}
     
    53995523
    54005524\pnum
    5401 \addedConcepts{\mbox{\enternote} constrained class templates involving
     5525\addedConcepts{\mbox{\enternote} Constrained class templates involving
    54025526  recursive definitions are ill-formed if the recursive class template
    54035527  specialization is an instantiated archetype. Constrained class
     
    54665590  functions and function templates that is defined in a constrained
    54675591  template (a \mbox{\techterm{retained}} \mbox{\techterm{candidate
    5468       set}},~\mbox{\ref{temp.constrained}}) or as the result of
     5592      set}},~\mbox{\ref{temp.constrained.inst}}) or as the result of
    54695593  satisfying an associated function requirement in a concept map (an
    54705594  \mbox{\techterm{associated}} \mbox{\techterm{function}} \mbox{\techterm{candidate
     
    54815605  which provides the basis for the candidate set itself. All
    54825606  functions and function templates that are consistent
    5483   with the seed are containing in the candidate set. The seed is
     5607  with the seed are contained in the candidate set. The seed is
    54845608  determined as part of the definition of
    54855609  the candidate set, and will be one of:}
     
    55065630  \mbox{\techterm{parameter-type-list}}s:}
    55075631\begin{itemize}
    5508   \additemCC{for a non-member function, add the implicit
     5632  \additemCC{for a non-static member function, add the implicit
    55095633    object parameter (\mbox{\ref{over.match.funcs}}) as the first
    55105634    parameter in the \mbox{\techterm{parameter-type-list}},}
     
    55395663\addedCC{the set of candidate functions for overload resolution is the
    55405664set of functions in the candidate set, and}
     5665
     5666\item
    55415667\addedCC{if template argument deduction on a candidate function
    55425668  produces a function template specialization that is not consistent
     
    56515777  those of
    56525778  \mbox{\tcode{A<T}$'$\tcode{>::m}} after replacing the archetypes with their
    5653   actual template argument types.}
     5779  actual template argument types,}
    56545780
    56555781\item \addedConcepts{for each member type \mbox{\tcode{t}} of \mbox{\tcode{A<T}$'$\tcode{>}} referenced
     
    56575783  \mbox{\tcode{A<X>}} that is accessible from the constrained
    56585784  template and is compatible with the member type
    5659     \mbox{\tcode{A<T}$'$\tcode{>::t}} as specified herein.}
     5785    \mbox{\tcode{A<T}$'$\tcode{>::t}} as specified herein, and}
    56605786
    56615787\item \addedConcepts{for each base class \mbox{\tcode{B}$'$ of \tcode{A<T}$'$\tcode{>}} referenced
Note: See TracChangeset for help on using the changeset viewer.