diff --git a/source/meta.tex b/source/meta.tex index 3217508a35..251256763c 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -4072,17 +4072,6 @@ Otherwise, \tcode{r} represents a variable; a reflection of the object declared by that variable. \end{itemize} -\begin{example} -\begin{codeblock} -int x; -int& y = x; - -static_assert(^^x != ^^y); // OK, \tcode{r} and \tcode{y} are different variables so their - // reflections compare different -static_assert(object_of(^^x) == object_of(^^y)); // OK, because \tcode{y} is a reference - // to \tcode{x}, their underlying objects are the same -\end{codeblock} -\end{example} \pnum \throws @@ -4102,6 +4091,19 @@ currently under evaluation. \end{itemize} \end{itemize} + +\pnum +\begin{example} +\begin{codeblock} +int x; +int& y = x; + +static_assert(^^x != ^^y); // OK, \tcode{r} and \tcode{y} are different variables so their + // reflections compare different +static_assert(object_of(^^x) == object_of(^^y)); // OK, because \tcode{y} is a reference + // to \tcode{x}, their underlying objects are the same +\end{codeblock} +\end{example} \end{itemdescr} \indexlibraryglobal{constant_of}% @@ -4126,6 +4128,15 @@ return reflect_constant([: @$R$@ :]); } \end{codeblock} + +\pnum +\throws +\tcode{meta::exception} unless +either \tcode{r} represents an annotation or +\tcode{[: $R$ :]} is a valid +\grammarterm{splice-expression}\iref{expr.prim.splice}. + +\pnum \begin{example} \begin{codeblock} constexpr int x = 0; @@ -4155,13 +4166,6 @@ constexpr info r = constant_of(fn()); // error: \tcode{x} is outside its lifetime \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -either \tcode{r} represents an annotation or -\tcode{[: $R$ :]} is a valid -\grammarterm{splice-expression}\iref{expr.prim.splice}. \end{itemdescr} \indexlibraryglobal{is_public}% @@ -4464,6 +4468,8 @@ \tcode{true} if \tcode{dealias(r)} represents a type that is enumerable from some point in the evaluation context. Otherwise, \tcode{false}. + +\pnum \begin{example} \begin{codeblock} class S; @@ -4864,6 +4870,13 @@ Otherwise, \tcode{\reflexpr{$E$}}. \end{itemize} \end{itemize} + +\pnum +\throws +\tcode{meta::exception} unless +\tcode{has_parent(r)} is \tcode{true}. + +\pnum \begin{example} \begin{codeblock} struct I { }; @@ -4887,11 +4900,6 @@ static_assert(parent_of(^^F::A) == ^^F::N); \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -\tcode{has_parent(r)} is \tcode{true}. \end{itemdescr} \indexlibraryglobal{dealias}% @@ -4903,6 +4911,13 @@ \pnum \returns A reflection representing the underlying entity of what \tcode{r} represents. + +\pnum +\throws +\tcode{meta::exception} unless +\tcode{r} represents an entity. + +\pnum \begin{example} \begin{codeblock} using X = int; @@ -4912,11 +4927,6 @@ static_assert(dealias(^^Y) == ^^int); \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -\tcode{r} represents an entity. \end{itemdescr} \indexlibraryglobal{has_template_arguments}% @@ -4994,6 +5004,13 @@ Otherwise, $R$ is a reflection representing the value of $A$. \end{itemize} \end{itemize} + +\pnum +\throws +\tcode{meta::exception} unless +\tcode{has_template_arguments(r)} is \tcode{true}. + +\pnum \begin{example} \begin{codeblock} template struct Pair { }; @@ -5019,11 +5036,6 @@ static_assert(template_arguments_of(T)[3] == ^^PairPtr); \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -\tcode{has_template_arguments(r)} is \tcode{true}. \end{itemdescr} \indexlibraryglobal{parameters_of}% @@ -5243,6 +5255,16 @@ is \tcode{\exposid{ctx-scope}($S$)}, where $S$ is the immediate scope of \tcode{\exposid{eval-point}($P$)} and $P$ is the point at which the invocation of \tcode{current} lexically appears. + +\pnum +\remarks +\tcode{current} is not an addressable function\iref{namespace.std}. +An invocation of \tcode{current} that appears at a program point $P$ +is value-dependent\iref{temp.dep.constexpr} +if \tcode{\exposid{eval-point}\brk{}(\brk{}$P$)} is enclosed by a scope +corresponding to a templated entity. + +\pnum \begin{example} \begin{codeblock} struct A { @@ -5284,14 +5306,6 @@ } \end{codeblock} \end{example} - -\pnum -\remarks -\tcode{current} is not an addressable function\iref{namespace.std}. -An invocation of \tcode{current} that appears at a program point $P$ -is value-dependent\iref{temp.dep.constexpr} -if \tcode{\exposid{eval-point}\brk{}(\brk{}$P$)} is enclosed by a scope -corresponding to a templated entity. \end{itemdescr} \begin{itemdecl} @@ -5411,6 +5425,20 @@ The definitions of when a class member or base class is accessible from a point $P$ do not consider whether a declaration of that entity is reachable from $P$. \end{note} + +\pnum +\throws +\tcode{meta::exception} if +\begin{itemize} +\item + \tcode{r} represents a class member + for which \tcode{\exposid{PARENT-CLS}(r)} is an incomplete class or +\item + \tcode{r} represents a direct base class relationship $(D, B)$ + for which $D$ is incomplete. +\end{itemize} + +\pnum \begin{example} \begin{codeblock} consteval access_context fn() { @@ -5429,18 +5457,6 @@ static_assert(is_accessible(Cls::r, access_context::unchecked())); // OK \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} if -\begin{itemize} -\item - \tcode{r} represents a class member - for which \tcode{\exposid{PARENT-CLS}(r)} is an incomplete class or -\item - \tcode{r} represents a direct base class relationship $(D, B)$ - for which $D$ is incomplete. -\end{itemize} \end{itemdescr} \indexlibraryglobal{has_inaccessible_nonstatic_data_members}% @@ -5605,6 +5621,15 @@ Implicitly-declared special members appear after any user-declared members\iref{special}. \end{note} + +\pnum +\throws +\tcode{meta::exception} unless +\tcode{dealias(r)} is a reflection representing either +a class type that is complete from some point in the evaluation context +or a namespace. + +\pnum \begin{example} \begin{codeblock} // TU1 @@ -5639,13 +5664,6 @@ // representing \tcode{S::I} \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -\tcode{dealias(r)} is a reflection representing either -a class type that is complete from some point in the evaluation context -or a namespace. \end{itemdescr} \indexlibraryglobal{bases_of}% @@ -5969,6 +5987,21 @@ \begin{note} The order in which two annotations appear is otherwise unspecified. \end{note} + +\pnum +\throws +\tcode{meta::exception} unless +\tcode{item} represents a +type, +type alias, +variable, +function, +namespace, +enumerator, +direct base class relationship, or +non-static data member. + +\pnum \begin{example} \begin{codeblock} [[=1]] void f(); @@ -6003,19 +6036,6 @@ static_assert(annotations_of(^^x)[0] == annotations_of(^^y)[0]); \end{codeblock} \end{example} - -\pnum -\throws -\tcode{meta::exception} unless -\tcode{item} represents a -type, -type alias, -variable, -function, -namespace, -enumerator, -direct base class relationship, or -non-static data member. \end{itemdescr} \indexlibraryglobal{annotations_of_with_type}%