From 6db4b2ac9e1e4c73a5264620a1226e1bf13e27f0 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sat, 28 Oct 2023 17:08:02 +0200 Subject: [PATCH] Clarify difference with previous paper --- src/D2989.tex | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/D2989.tex b/src/D2989.tex index 4ceab9d..871c9e6 100644 --- a/src/D2989.tex +++ b/src/D2989.tex @@ -45,7 +45,19 @@ \subsection{R0} \section{Difference with \paper{P1985R3}} This paper is really a follow-up on \paper{P1985R3}. -The main difference is that we are merely proposing that universal template parameters can be used only as template arguments, to side step parsing ambiguities, syntax disambiguators, and so on. +The main difference is that we are merely proposing that universal template parameters can be used only as template arguments of other templates. +They cannot be used in any other context. + +\begin{colorblock} +template +void f() { + SomeOtherTemplate(); // ok. + U foo; // error: U is not used as a template argument. + U = 0; // error: U is not used as a template argument. +} +\end{colorblock} + +This change was made to simplify the design as it completely side step parsing ambiguities, syntax disambiguators, and so on. Other than this change, the feature and the design are still very much the same (this feature presents few design options). We present some new design questions not considered in earlier papers and report on early implementation efforts in Clang. @@ -134,7 +146,7 @@ \subsection{Partial ordering of universal template parameters} Anything that can be a template argument can be the argument of a universal template parameter, hence the name \emph{universal template parameter}. -Consequently, universal template oarameters are less specialized than any other sort of template with which they are compared, +Consequently, universal template parameters are less specialized than any other sort of template with which they are compared, which allows specializing an entity based on template parameter kind. \begin{colorblock}