Skip to content

Commit cdbd60e

Browse files
eisenwavetkoeppe
authored andcommitted
P3914R0: Re NB US 130-193 (C++26 CD)
Fixes NB US 130-193 (C++26 CD).
1 parent 23104c0 commit cdbd60e

File tree

1 file changed

+50
-15
lines changed

1 file changed

+50
-15
lines changed

source/meta.tex

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6870,6 +6870,41 @@
68706870
consteval info @\libglobal{unwrap_ref_decay}@(info type);
68716871
\end{codeblock}
68726872

6873+
\pnum
6874+
For a function or function template $F$ defined in this subclause,
6875+
let $C$ be its associated class template.
6876+
For the evaluation of a call to $F$,
6877+
let $S$ be the specialization of $C$ in terms of which the call is specified.
6878+
\begin{itemize}
6879+
\item
6880+
If
6881+
\begin{itemize}
6882+
\item
6883+
the template arguments of $S$ violate a condition specified
6884+
in a \Fundescx{Mandates} element in the specification of $C$;
6885+
\item
6886+
the call is specified to produce a reflection of a type,
6887+
but $S$ would have no member named \tcode{type}; or
6888+
\item
6889+
the call is specified to return \tcode{$S$::value},
6890+
but that expression would not be a valid converted constant expression of type \tcode{R},
6891+
where \tcode{R} is the return type of $F$;
6892+
\end{itemize}
6893+
then an exception of type \tcode{meta::exception} is thrown.
6894+
\begin{note}
6895+
For the first case, $S$ is not instantiated.
6896+
\end{note}
6897+
\item
6898+
Otherwise, if the instantiation of $S$ would result in undefined behavior
6899+
due to dependence on an incomplete type\iref{meta.rqmts},
6900+
then the call is not a constant subexpression.
6901+
\item
6902+
Otherwise, if the template arguments of $S$ do not meet the preconditions of $C$,
6903+
then it is unspecified whether the call is a constant subexpression.
6904+
If it is, the call produces the result
6905+
that would be produced if $C$ had no preconditions.
6906+
\end{itemize}
6907+
68736908
\pnum
68746909
Each function or function template declared above has the following behavior
68756910
based on the signature and return type of that function or function template.
@@ -6888,28 +6923,28 @@
68886923

68896924
\tcode{bool meta::\placeholder{UNARY}(info type);\br
68906925
bool meta::\placeholder{UNARY}_type(info type);} &
6891-
\tcode{std::\placeholder{UNARY}_v<$T$>},
6926+
\tcode{std::\placeholder{UNARY}<$T$>::value},
68926927
where $T$ is the type or type alias represented by \tcode{type}
68936928
\\ \rowsep
68946929

68956930
\tcode{bool meta::\placeholder{BINARY}(info t1, info t2);\br
68966931
bool meta::\placeholder{BINARY}_type(info t1, info t2);} &
6897-
\tcode{std::\placeholder{BINARY}_v<$T_1$, $T_2$>},
6932+
\tcode{std::\placeholder{BINARY}<$T_1$, $T_2$>::value},
68986933
where $T_1$ and $T_2$ are the types or type aliases
68996934
represented by \tcode{t1} and \tcode{t2}, respectively
69006935
\\ \rowsep
69016936

69026937
\tcode{template<reflection_range R>\br
69036938
bool meta::\placeholder{VARIADIC}_type(info type, R\&\& args);} &
6904-
\tcode{std::\placeholder{VARIADIC}_v<$T$, $U$...>},
6939+
\tcode{std::\placeholder{VARIADIC}<$T$, $U$...>::value},
69056940
where $T$ is the type or type alias represented by \tcode{type}
69066941
and \tcode{U...} is the pack of types or type aliases
69076942
whose elements are represented by the corresponding elements of \tcode{args}
69086943
\\ \rowsep
69096944

69106945
\tcode{template<reflection_range R>\br
69116946
bool meta::\placeholder{VARIADIC}_type(info t1, info t2, R\&\& args);} &
6912-
\tcode{std::\placeholder{VARIADIC}_v<$T_1$, $T_2$, $U$...>},
6947+
\tcode{std::\placeholder{VARIADIC}<$T_1$, $T_2$, $U$...>::value},
69136948
where $T_1$ and $T_2$ are the types or type aliases
69146949
represented by \tcode{t1} and \tcode{t2}, respectively,
69156950
and \tcode{$U$...} is the pack of types or type aliases
@@ -6918,22 +6953,22 @@
69186953

69196954
\tcode{info meta::\placeholder{UNARY}(info type);} &
69206955
A reflection representing the type denoted by
6921-
\tcode{std::\placeholder{UNARY}_t<\brk{}$T$>},
6956+
\tcode{std::\placeholder{UNARY}<\brk{}$T$>::type},
69226957
where $T$ is the type or type alias represented by \tcode{type}
69236958
\\ \rowsep
69246959

69256960
\tcode{template<reflection_range R>\br
69266961
info meta::\placeholder{VARIADIC}(R\&\& args);} &
69276962
A reflection representing the type denoted by
6928-
\tcode{std::\placeholder{VARIADIC}_t<$T$...>},
6963+
\tcode{std::\placeholder{VARIADIC}<$T$...>::type},
69296964
where \tcode{$T$...} is the pack of types or type aliases
69306965
whose elements are represented by the corresponding elements of \tcode{args}
69316966
\\ \rowsep
69326967

69336968
\tcode{template<reflection_range R>\br
69346969
info meta::\placeholder{VARIADIC}(info type, R\&\& args);} &
69356970
A reflection representing the type denoted by
6936-
\tcode{std::\placeholder{VARIADIC}_t<$T$, $U$...>},
6971+
\tcode{std::\placeholder{VARIADIC}<$T$, $U$...>::type},
69376972
where \tcode{$T$} is the type or type alias represented by \tcode{type}
69386973
and \tcode{$U$...} is the pack of types or type aliases
69396974
whose elements are represented by the corresponding elements of \tcode{args}
@@ -6963,7 +6998,7 @@
69636998
\begin{itemdescr}
69646999
\pnum
69657000
\returns
6966-
\tcode{rank_v<$T$>},
7001+
\tcode{std::rank<$T$>::value},
69677002
where $T$ is the type represented by \tcode{dealias(type)}.
69687003
\end{itemdescr}
69697004

@@ -6975,7 +7010,7 @@
69757010
\begin{itemdescr}
69767011
\pnum
69777012
\returns
6978-
\tcode{extent_v<$T$, $I$>},
7013+
\tcode{std::extent<$T$, $I$>::value},
69797014
where $T$ is the type represented by \tcode{dealias(type)}
69807015
and $I$ is a constant equal to \tcode{i}.
69817016
\end{itemdescr}
@@ -6988,7 +7023,7 @@
69887023
\begin{itemdescr}
69897024
\pnum
69907025
\returns
6991-
\tcode{tuple_size_v<$T$>},
7026+
\tcode{std::tuple_size<$T$>::value},
69927027
where $T$ is the type represented by \tcode{dealias(type)}.
69937028
\end{itemdescr}
69947029

@@ -7001,7 +7036,7 @@
70017036
\pnum
70027037
\returns
70037038
A reflection representing
7004-
the type denoted by \tcode{tuple_element_t<$I$, $T$>},
7039+
the type denoted by \tcode{std::tuple_element<$I$, $T$>::type},
70057040
where $T$ is the type represented by \tcode{dealias(type)}
70067041
and $I$ is a constant equal to \tcode{index}.
70077042
\end{itemdescr}
@@ -7014,7 +7049,7 @@
70147049
\begin{itemdescr}
70157050
\pnum
70167051
\returns
7017-
\tcode{variant_size_v<$T$>},
7052+
\tcode{std::variant_size<$T$>::value},
70187053
where $T$ is the type represented by \tcode{dealias(type)}.
70197054
\end{itemdescr}
70207055

@@ -7027,7 +7062,7 @@
70277062
\pnum
70287063
\returns
70297064
A reflection representing the type denoted by
7030-
\tcode{variant_alternative_t<$I$, $T$>},
7065+
\tcode{std::variant_alternative<$I$, $T$>::type},
70317066
where $T$ is the type represented by \tcode{dealias(type)}
70327067
and $I$ is a constant equal to \tcode{index}.
70337068
\end{itemdescr}
@@ -7040,9 +7075,9 @@
70407075
\begin{itemdescr}
70417076
\pnum
70427077
\returns
7043-
\tcode{type_order_v<$T_1$, $T_2$>},
7078+
\tcode{std::type_order<$T_1$, $T_2$>::value},
70447079
where $T_1$ and $T_2$ are the types
7045-
represented by \tcode{dealias(t1)} and \tcode{dealias(t2)}, respectively.
7080+
represented by \tcode{de\-alias(\brk{}t1)} and \tcode{dealias(t2)}, respectively.
70467081
\end{itemdescr}
70477082

70487083
\rSec1[ratio]{Compile-time rational arithmetic}

0 commit comments

Comments
 (0)