From d60ec60f3b27a15ca83647983550e61d36c3a1e8 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Tue, 12 Jun 2018 06:26:49 -0400 Subject: [PATCH 01/33] P0619R4 Review of deprecated facilities --- source/compatibility.tex | 136 ++++-- source/containers.tex | 1 + source/exceptions.tex | 7 +- source/future.tex | 958 +-------------------------------------- source/iostreams.tex | 2 + source/iterators.tex | 3 + source/lib-intro.tex | 57 ++- source/numerics.tex | 3 + source/utilities.tex | 13 +- source/xrefdelta.tex | 17 + 10 files changed, 196 insertions(+), 1001 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index a5d7679a2d..21e12edad4 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1085,13 +1085,9 @@ and \tcode{}. In addition the following C compatibility headers are new: -\tcode{}, \tcode{}, \tcode{}, -\tcode{}, -\tcode{}, \tcode{}, -\tcode{}, and \tcode{}. Valid \CppIII{} code that \tcode{\#include}{s} headers with these names may be @@ -1186,7 +1182,7 @@ have different runtime behavior. \diffref{refwrap}, \ref{arithmetic.operations}, \ref{comparisons}, -\ref{logical.operations}, \ref{bitwise.operations}, \ref{depr.negators} +\ref{logical.operations}, \ref{bitwise.operations} \change Standard function object types no longer derived from \tcode{std::unary_function} or \tcode{std::binary_function}. \rationale Superseded by new feature; \tcode{unary_function} and @@ -1987,6 +1983,20 @@ } \end{codeblock} +\rSec2[diff.cpp17.except]{\ref{except}: exception handling} + +\diffref{except.spec} +\change Remove \tcode{throw()} exception specification. +\rationale +The empty dynamic exception specification was retained for one additional \Cpp{} +Standard to ease the transition away from this feature. +\effect +A valid \CppXVII{} function declaration, member function declaration, function +pointer declaration, or function reference declaration that uses \tcode{throw()} +for its exception specification will be rejected as ill-formed in this +International Standard. It should simply be replaced with \tcode{noexcept} for no +change of meaning since \CppXVII{}. + \rSec2[diff.cpp17.library]{\ref{library}: library introduction} \diffref{headers} @@ -2001,6 +2011,19 @@ Valid \CppXVII{} code that \tcode{\#include}{s} headers with these names may be invalid in this International Standard. +\diffref{headers} +\change Remove vacuous \Cpp{} header files. +\rationale +The empty headers implied a false requirement to achieve C compatibility with the \Cpp{} headers. +\effect +A valid \CppXVII{} program that \tcode{\#include}{s} any of the following headers may fail to compile: +\tcode{}, +\tcode{}, +\tcode{}, +\tcode{}, and +\tcode{}. +The \tcode{\#include} directives can simply be removed with no loss of meaning. + \rSec2[diff.cpp17.containers]{\ref{containers}: containers library} \diffrefs{forwardlist}{list} @@ -2013,6 +2036,83 @@ Translation units compiled against this version of \Cpp{} may be incompatible with translation units compiled against \CppXVII{}, either failing to link or having undefined behavior. +\rSec2[diff.cpp17.depr]{\ref{depr}: compatibility features} + +\change Remove \tcode{uncaught_exception}. +\rationale +The function did not have a clear specification when multiple exceptions were +active, and has been superseded by \tcode{uncaught_exceptions}. +\effect +A valid \CppXVII{} program that calls \tcode{std::uncaught_exception} may fail +to compile. It might be revised to use \tcode{std::uncaught_exceptions} instead, +for clear and portable semantics. + +\change Remove support for adaptable function API. +\rationale +The deprecated support relied on a limited convention that could not be +extended to support the general case or new language features. It has been +superseded by direct language support with \tcode{decltype}, and by the +\tcode{std::bind} and \tcode{std::not_fn} function templates. +\effect +A valid \CppXVII{} program that relies on the presence of \tcode{result_type}, +\tcode{argument_type}, \tcode{first_argument_type}, or +\tcode{second_argument_type} in a standard library class may fail to compile. A +valid \CppXVII{} program that calls \tcode{not1} or \tcode{not2}, or uses the +class templates \tcode{unary_negate} or \tcode{binary_negate}, may fail to +compile. + +\change Remove redundant members from \tcode{std::allocator}. +\rationale +\tcode{std::allocator} was overspecified, encouraging direct usage in user containers +rather than relying on \tcode{std::allocator_traits}, leading to poor containers. +\effect +A valid \CppXVII{} program that directly makes use of the \tcode{pointer}, +\tcode{const_pointer}, \tcode{reference}, \tcode{const_reference}, +\tcode{rebind}, \tcode{address}, \tcode{construct}, \tcode{destroy}, or +\tcode{max_size} members of \tcode{std::allocator}, or that directly calls +\tcode{allocate} with an additional hint argument, may fail to compile. + +\change Remove \tcode{raw_memory_iterator}. +\rationale +The iterator encouraged use of algorithms that might throw exceptions, but did +not return the number of elements successfully constructed that might need to +be destroyed in order to avoid leaks. +\effect +A valid \CppXVII{} program that uses this iterator class may fail to compile. + +\change Remove temporary buffers API. +\rationale +The temporary buffer facility was intended to provide an efficient optimization +for small memory requests, but there is little evidence this was achieved in +practice, while requiring the user to provide their own exception-safe wrappers +to guard use of the facility in many cases. +\effect +A valid \CppXVII{} program that calls \tcode{get_temporary_buffer} or +\tcode{return_temporary_buffer} may fail to compile. + +\change Remove \tcode{shared_ptr::unique}. +\rationale +The result of a call to this member function is not reliable in the presence of +multiple threads and weak pointers. The member function \tcode{use_count} is +similarly unreliable, but has a clearer contract in such cases, and remains +available for well defined use in single-threaded cases. +\effect +A valid \CppXVII{} program that calls \tcode{unique} on a \tcode{shared_ptr} +object may fail to compile. + +\diffref{depr.meta.types} +\change Remove deprecated type traits. +\rationale +The traits had unreliable or awkward interfaces. The \tcode{is_literal_type} +trait provided no way to detect which subset of constructors and member +functions of a type were declared \tcode{constexpr}. The \tcode{result_of} +trait had a surprising syntax that could not report the result of a regular +function type. It has been superseded by the \tcode{invoke_result} trait. +\effect +A valid \CppXVII{} program that relies on the \tcode{is_literal_type} or +\tcode{result_of} type traits, on the \tcode{is_literal_type_v} variable template, +or on the \tcode{result_of_t} alias template may fail to compile. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \rSec1[diff.library]{C standard library} \indextext{library!C standard}% @@ -2038,20 +2138,10 @@ nor are the C headers themselves part of \Cpp{}. \pnum -The \Cpp{} headers \tcode{}\indexhdr{ccomplex}\iref{depr.ccomplex.syn} -and \tcode{}\indexhdr{ctgmath}\iref{depr.ctgmath.syn}, as well -as their corresponding C headers \tcode{}\indexhdr{complex.h} -and \tcode{}\indexhdr{tgmath.h}, do not contain any of the -content from the C standard library and instead merely include other headers -from the \Cpp{} standard library. - -\pnum -The headers \tcode{}\indexhdr{ciso646}, -\tcode{}\indexhdr{cstdalign}\iref{depr.cstdalign.syn}, -and \tcode{}\indexhdr{cstdbool}\iref{depr.cstdbool.syn} -are meaningless in \Cpp{}. Use of -the \Cpp{} headers \tcode{}, \tcode{}, \tcode{}, -and \tcode{} is deprecated\iref{depr.c.headers}. +The C headers \tcode{}\indexhdr{complex.h} and +\tcode{}\indexhdr{tgmath.h} do not contain any of the content from +the C standard library and instead merely include other headers from the \Cpp{} +standard library. \rSec2[diff.mods.to.definitions]{Modifications to definitions} @@ -2104,17 +2194,13 @@ \tcode{xor_eq} are keywords in this International Standard\iref{lex.key}. -They do not appear as macro names defined in -\tcode{}. -\indexhdr{ciso646}% \rSec3[diff.header.stdalign.h]{Header \tcode{}} \indexhdr{stdalign.h}% \pnum The token \tcode{alignas} is a keyword in this International -Standard\iref{lex.key}. It does not appear as a macro name defined -in \tcode{}\indexhdr{cstdalign}\iref{depr.cstdalign.syn}. +Standard\iref{lex.key}. \rSec3[diff.header.stdbool.h]{Header \tcode{}} \indexhdr{stdbool.h}% @@ -2122,8 +2208,6 @@ \pnum The tokens \tcode{bool}, \tcode{true}, and \tcode{false} are keywords in this International Standard\iref{lex.key}. -They do not appear as macro names defined in -\tcode{}\indexhdr{cstdbool}\iref{depr.cstdbool.syn}. \rSec3[diff.null]{Macro \tcode{NULL}} diff --git a/source/containers.tex b/source/containers.tex index 446281560b..a2c68cd581 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5628,6 +5628,7 @@ friend class vector; reference() noexcept; public: + reference(const reference&) = default; ~reference(); operator bool() const noexcept; reference& operator=(const bool x) noexcept; diff --git a/source/exceptions.tex b/source/exceptions.tex index 6b3df5a183..2fd222d970 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -705,7 +705,6 @@ \nontermdef{noexcept-specifier}\br \terminal{noexcept} \terminal{(} constant-expression \terminal{)}\br \terminal{noexcept}\br - \terminal{throw} \terminal{(} \terminal{)} \end{bnf} \pnum @@ -723,10 +722,6 @@ is equivalent to the \grammarterm{noexcept-specifier} \tcode{noexcept(true)}. -The \grammarterm{noexcept-specifier} \tcode{throw()} -is deprecated\iref{depr.except.spec}, and -equivalent to the \grammarterm{noexcept-specifier} -\tcode{noexcept(true)}. \pnum If a declaration of a function @@ -920,7 +915,7 @@ ~A(); }; struct B { - B() throw(); + B() noexcept; B(const B&) = default; // implicit exception specification is \tcode{noexcept(true)} B(B&&, int = (throw Y(), 0)) noexcept; ~B() noexcept(false); diff --git a/source/future.tex b/source/future.tex index 52984d0a9c..44ef2d5fb7 100644 --- a/source/future.tex +++ b/source/future.tex @@ -102,87 +102,6 @@ In a future revision of this International Standard, these implicit definitions could become deleted\iref{dcl.fct.def}. -\rSec1[depr.except.spec]{Deprecated exception specifications} - -\pnum -The \grammarterm{noexcept-specifier} \tcode{throw()} is deprecated. - -\rSec1[depr.cpp.headers]{\Cpp{} standard library headers} - -\pnum -For compatibility with prior \Cpp{} International Standards, -the \Cpp{} standard library provides headers -\tcode{}\iref{depr.ccomplex.syn}, -\tcode{}\iref{depr.cstdalign.syn}, -\tcode{}\iref{depr.cstdbool.syn}, -and \tcode{}\iref{depr.ctgmath.syn}. -The use of these headers is deprecated. - -\rSec2[depr.ccomplex.syn]{Header \tcode{} synopsis} -\indexhdr{ccomplex}% - -\begin{codeblock} -#include -\end{codeblock} - -\pnum -The header \tcode{} -behaves as if it simply includes the header -\tcode{}\iref{complex.syn}. - -\rSec2[depr.cstdalign.syn]{Header \tcode{} synopsis} - -\indexlibrary{\idxcode{__alignas_is_defined}}% -\indexhdr{cstdalign}% -\begin{codeblock} -#define @\xname{alignas_is_defined}@ 1 -\end{codeblock} - -\pnum -\indexhdr{cstdalign}% -\indexhdr{stdalign.h}% -The contents of the header \tcode{} are the same as the C -standard library header \tcode{}, with the following changes: -The header \tcode{} and the header \tcode{} shall not -define a macro named \tcode{alignas}. - -\xrefc{7.15} - -\rSec2[depr.cstdbool.syn]{Header \tcode{} synopsis} - -\indexhdr{cstdbool}% -\indexlibrary{\idxcode{__bool_true_false_are_defined}}% -\begin{codeblock} -#define @\xname{bool_true_false_are_defined}@ 1 -\end{codeblock} - -\pnum -\indexhdr{stdbool.h}% -The contents of the header \tcode{} are the same as the C -standard library header \tcode{}, with the following changes: -The header \tcode{} and the header \tcode{} shall not -define macros named \tcode{bool}, \tcode{true}, or \tcode{false}. - -\xrefc{7.18} - -\rSec2[depr.ctgmath.syn]{Header \tcode{} synopsis} - -\indexhdr{ctgmath}% -\begin{codeblock} -#include -#include -\end{codeblock} - -\pnum -The header \tcode{} simply includes the headers -\tcode{}\iref{complex.syn} -and \tcode{}\iref{cmath.syn}. - -\pnum -\begin{note} The overloads provided in C by type-generic macros are already -provided in \tcode{} and \tcode{} by ``sufficient'' additional -overloads.\end{note} - \rSec1[depr.c.headers]{C standard library headers} \pnum @@ -230,8 +149,9 @@ \end{floattable} \pnum -The header \tcode{} behaves as if it simply includes the header \tcode{}. -The header \tcode{} behaves as if it simply includes the header \tcode{}. +The header \tcode{} behaves as if it simply includes the header \tcode{}\iref{complex.syn}. +The header \tcode{} behaves as if it simply includes the headers \tcode{}\iref{complex.syn} +and \tcode{}\iref{cmath.syn}. \pnum Every other C header, each of @@ -1401,813 +1321,6 @@ \tcode{rdbuf()->pcount()}. \end{itemdescr} -\rSec1[depr.uncaught]{\tcode{uncaught_exception}} - -\pnum -The header -\indexhdr{exception}% -\tcode{} has the following addition: - -\indexlibrary{\idxcode{iterator}}% -\begin{codeblock} -namespace std { - bool uncaught_exception() noexcept; -} -\end{codeblock} - -\indexlibrary{\idxcode{uncaught_exception}}% -\begin{itemdecl} -bool uncaught_exception() noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns \tcode{uncaught_exceptions() > 0}. -\end{itemdescr} - -\rSec1[depr.func.adaptor.binding]{Old adaptable function bindings} - -\rSec2[depr.weak.result_type]{Weak result types} - -\pnum -A call wrapper\iref{func.def} may have a \defn{weak result type}. -If it does, the type of its member type \tcode{result_type} -is based on the type \tcode{T} of the wrapper's target object: -\begin{itemize} -\item if \tcode{T} is a pointer to function type, -\tcode{result_type} shall be a synonym for the return type of \tcode{T}; -\item if \tcode{T} is a pointer to member function, -\tcode{result_type} shall be a synonym for the return type of \tcode{T}; -\item if \tcode{T} is a class type -and the \grammarterm{qualified-id} \tcode{T::result_type} is valid and denotes a type\iref{temp.deduct}, -then \tcode{result_type} shall be a synonym for \tcode{T::result_type}; -\item otherwise \tcode{result_type} shall not be defined. -\end{itemize} - -\rSec2[depr.func.adaptor.typedefs]{Typedefs to support function binders} - -\pnum -To enable old function adaptors to manipulate function objects -that take one or two arguments, -many of the function objects in this document -correspondingly provide \grammarterm{typedef-name}{s} -\tcode{argument_type} and \tcode{result_type} -for function objects that take one argument and -\tcode{first_argument_type}, \tcode{second_argument_type}, and \tcode{result_type} -for function objects that take two arguments. - -\pnum -The following member names are defined in addition to names specified in \ref{function.objects}: - -\indexlibrarymember{result_type}{owner_less}% -\indexlibrarymember{first_argument_type}{owner_less}% -\indexlibrarymember{second_argument_type}{owner_less}% -\indexlibrarymember{result_type}{owner_less}% -\indexlibrarymember{first_argument_type}{owner_less}% -\indexlibrarymember{second_argument_type}{owner_less}% -\indexlibrarymember{result_type}{plus}% -\indexlibrarymember{first_argument_type}{plus}% -\indexlibrarymember{second_argument_type}{plus}% -\indexlibrarymember{result_type}{minus}% -\indexlibrarymember{first_argument_type}{minus}% -\indexlibrarymember{second_argument_type}{minus}% -\indexlibrarymember{result_type}{multiplies}% -\indexlibrarymember{first_argument_type}{multiplies}% -\indexlibrarymember{second_argument_type}{multiplies}% -\indexlibrarymember{result_type}{divides}% -\indexlibrarymember{first_argument_type}{divides}% -\indexlibrarymember{second_argument_type}{divides}% -\indexlibrarymember{result_type}{modulus}% -\indexlibrarymember{first_argument_type}{modulus}% -\indexlibrarymember{second_argument_type}{modulus}% -\indexlibrarymember{result_type}{negate}% -\indexlibrarymember{argument_type}{negate}% -\indexlibrarymember{result_type}{equal_to}% -\indexlibrarymember{first_argument_type}{equal_to}% -\indexlibrarymember{second_argument_type}{equal_to}% -\indexlibrarymember{result_type}{not_equal_to}% -\indexlibrarymember{first_argument_type}{not_equal_to}% -\indexlibrarymember{second_argument_type}{not_equal_to}% -\indexlibrarymember{result_type}{greater}% -\indexlibrarymember{first_argument_type}{greater}% -\indexlibrarymember{second_argument_type}{greater}% -\indexlibrarymember{result_type}{less}% -\indexlibrarymember{first_argument_type}{less}% -\indexlibrarymember{second_argument_type}{less}% -\indexlibrarymember{result_type}{greater_equal}% -\indexlibrarymember{first_argument_type}{greater_equal}% -\indexlibrarymember{second_argument_type}{greater_equal}% -\indexlibrarymember{result_type}{less_equal}% -\indexlibrarymember{first_argument_type}{less_equal}% -\indexlibrarymember{second_argument_type}{less_equal}% -\indexlibrarymember{result_type}{logical_and}% -\indexlibrarymember{first_argument_type}{logical_and}% -\indexlibrarymember{second_argument_type}{logical_and}% -\indexlibrarymember{result_type}{logical_or}% -\indexlibrarymember{first_argument_type}{logical_or}% -\indexlibrarymember{second_argument_type}{logical_or}% -\indexlibrarymember{result_type}{logical_not}% -\indexlibrarymember{argument_type}{logical_not}% -\indexlibrarymember{result_type}{bit_and}% -\indexlibrarymember{first_argument_type}{bit_and}% -\indexlibrarymember{second_argument_type}{bit_and}% -\indexlibrarymember{result_type}{bit_or}% -\indexlibrarymember{first_argument_type}{bit_or}% -\indexlibrarymember{second_argument_type}{bit_or}% -\indexlibrarymember{result_type}{bit_xor}% -\indexlibrarymember{first_argument_type}{bit_xor}% -\indexlibrarymember{second_argument_type}{bit_xor}% -\indexlibrarymember{result_type}{bit_not}% -\indexlibrarymember{argument_type}{bit_not}% -\indexlibrarymember{result_type}{function}% -\indexlibrarymember{argument_type}{function}% -\indexlibrarymember{first_argument_type}{function}% -\indexlibrarymember{second_argument_type}{function}% -\begin{codeblock} -namespace std { - template struct owner_less> { - using result_type = bool; - using first_argument_type = shared_ptr; - using second_argument_type = shared_ptr; - }; - - template struct owner_less> { - using result_type = bool; - using first_argument_type = weak_ptr; - using second_argument_type = weak_ptr; - }; - - template class reference_wrapper { - public: - using result_type = @\seebelow@; // not always defined - using argument_type = @\seebelow@; // not always defined - using first_argument_type = @\seebelow@; // not always defined - using second_argument_type = @\seebelow@; // not always defined - }; - - template struct plus { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct minus { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct multiplies { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct divides { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct modulus { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct negate { - using argument_type = T; - using result_type = T; - }; - - template struct equal_to { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct not_equal_to { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct greater { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct less { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct greater_equal { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct less_equal { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct logical_and { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct logical_or { - using first_argument_type = T; - using second_argument_type = T; - using result_type = bool; - }; - - template struct logical_not { - using argument_type = T; - using result_type = bool; - }; - - template struct bit_and { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct bit_or { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct bit_xor { - using first_argument_type = T; - using second_argument_type = T; - using result_type = T; - }; - - template struct bit_not { - using argument_type = T; - using result_type = T; - }; - - template class function { - public: - using argument_type = T1; - }; - - template class function { - public: - using first_argument_type = T1; - using second_argument_type = T2; - }; -} -\end{codeblock} - -\indexlibrary{\idxcode{reference_wrapper}!weak result type}% -\pnum -\tcode{reference_wrapper} has a weak result type\iref{depr.weak.result_type}. -If \tcode{T} is a function type, -\tcode{result_type} shall be a synonym for the return type of \tcode{T}. - -\indexlibrarymember{argument_type}{reference_wrapper}% -\pnum -The template specialization \tcode{reference_wrapper} -shall define a nested type named \tcode{argument_type} -as a synonym for \tcode{T1} -only if the type \tcode{T} is any of the following: -\begin{itemize} -\item a function type or a pointer to function type taking one argument of type \tcode{T1} -\item a pointer to member function \tcode{R T0::f()} \cv{} (where \cv{} represents the member function's cv-qualifiers); the type \tcode{T1} is \cv{}~\tcode{T0*} -\item a class type where the \grammarterm{qualified-id} \tcode{T::argument_type} -is valid and denotes a type\iref{temp.deduct}; -the type \tcode{T1} is \tcode{T::argument_type}. -\end{itemize} - -\indexlibrarymember{first_argument_type}{reference_wrapper}% -\indexlibrarymember{second_argument_type}{reference_wrapper}% -\pnum -The template instantiation \tcode{reference_wrapper} -shall define two nested types -named \tcode{first_argument_type} and \tcode{second_argument_type} -as synonyms for \tcode{T1} and \tcode{T2}, respectively, -only if the type \tcode{T} is any of the following: -\begin{itemize} -\item a function type or a pointer to function type taking two arguments of types \tcode{T1} and \tcode{T2} -\item a pointer to member function \tcode{R T0::f(T2)} \cv{} (where \cv{} represents the member function's cv-qualifiers); the type \tcode{T1} is \cv{}~\tcode{T0*} -\item a class type where the \grammarterm{qualified-id}{s} -\tcode{T::first_argument_type} and \tcode{T::second_argument_type} -are both valid and both denote types\iref{temp.deduct}; -the type \tcode{T1} is \tcode{T::first_argument_type} and -the type \tcode{T2} is \tcode{T::second_argument_type}. -\end{itemize} - -\indexlibrarymember{result_type}{hash}% -\indexlibrarymember{argument_type}{hash}% -\pnum -All enabled specializations \tcode{hash} of \tcode{hash}\iref{unord.hash} -provide two nested types, \tcode{result_type} and \tcode{argument_type}, -which shall be synonyms for \tcode{size_t} and \tcode{Key}, respectively. - -\indexlibrary{\idxcode{bind}!weak result type}% -\pnum -The forwarding call wrapper \tcode{g} -returned by a call to \tcode{bind(f, bound_args...)}\iref{func.bind.bind} -shall have a weak result type\iref{depr.weak.result_type}. - -\pnum -The forwarding call wrapper \tcode{g} -returned by a call to \tcode{bind(f, bound_args...)}\iref{func.bind.bind} -shall have a nested type \tcode{result_type} defined as a synonym for \tcode{R}. - -\indexlibrarymember{result_type}{mem_fn}% -\pnum -The simple call wrapper -returned from a call to \tcode{mem_fn(pm)} -shall have a nested type \tcode{result_type} -that is a synonym for -the return type of \tcode{pm} -when \tcode{pm} is a pointer to member function. - -\indexlibrarymember{result_type}{mem_fn}% -\indexlibrarymember{argument_type}{mem_fn}% -\pnum -The simple call wrapper -returned from a call to \tcode{mem_fn(pm)} -shall define two nested types -named \tcode{argument_type} and \tcode{result_type} -as synonyms for \cv{}~\tcode{T*} and \tcode{Ret}, respectively, -when \tcode{pm} is a pointer to member function -with cv-qualifier \cv{} -and taking no arguments, -where \tcode{Ret} is \tcode{pm}{'s} return type. - -\indexlibrarymember{result_type}{mem_fn}% -\indexlibrarymember{first_argument_type}{mem_fn}% -\indexlibrarymember{second_argument_type}{mem_fn}% -\pnum -The simple call wrapper -returned from a call to \tcode{mem_fn(pm)} -shall define three nested types -named \tcode{first_argument_type}, \tcode{second_argument_type}, and \tcode{result_type} -as synonyms for \cv{}~\tcode{T*}, \tcode{T1}, and \tcode{Ret}, respectively, -when \tcode{pm} is a pointer to member function -with cv-qualifier \cv{} -and taking one argument of type \tcode{T1}, -where \tcode{Ret} is \tcode{pm}{'s} return type. - -\pnum -The following member names are defined in addition to names specified in \ref{containers}: - -\indexlibrarymember{result_type}{map::value_compare}% -\indexlibrarymember{first_argument_type}{map::value_compare}% -\indexlibrarymember{second_argument_type}{map::value_compare}% -\indexlibrarymember{result_type}{multimap::value_compare}% -\indexlibrarymember{first_argument_type}{multimap::value_compare}% -\indexlibrarymember{second_argument_type}{multimap::value_compare}% -\begin{codeblock} -namespace std { - template - class map::value_compare { - public: - using result_type = bool; - using first_argument_type = value_type; - using second_argument_type = value_type; - }; - - template - class multimap::value_compare { - public: - using result_type = bool; - using first_argument_type = value_type; - using second_argument_type = value_type; - }; -} -\end{codeblock} - -\rSec2[depr.negators]{Negators} - -\pnum -The header -\indexhdr{functional}% -\tcode{} has the following additions: - -\indexlibrary{\idxcode{unary_negate}}% -\indexlibrary{\idxcode{not1}}% -\indexlibrary{\idxcode{binary_negate}}% -\indexlibrary{\idxcode{not2}}% -\begin{codeblock} -namespace std { - template class unary_negate; - template - constexpr unary_negate not1(const Predicate&); - template class binary_negate; - template - constexpr binary_negate not2(const Predicate&); -} -\end{codeblock} - -\pnum -Negators \tcode{not1} and \tcode{not2} -take a unary and a binary predicate, respectively, -and return their logical negations\iref{expr.unary.op}. - -\indexlibrary{\idxcode{unary_negate}}% -\indexlibrarymember{argument_type}{unary_negate}% -\indexlibrarymember{result_type}{unary_negate}% -\begin{codeblock} -template -class unary_negate { -public: - constexpr explicit unary_negate(const Predicate& pred); - constexpr bool operator()(const typename Predicate::argument_type& x) const; - using argument_type = typename Predicate::argument_type; - using result_type = bool; -}; -\end{codeblock} - -\indexlibrarymember{operator()}{unary_negate}% -\begin{itemdecl} -constexpr bool operator()(const typename Predicate::argument_type& x) const; -\end{itemdecl} - -\begin{itemdescr} -\pnum \returns \tcode{!pred(x)}. -\end{itemdescr} - -\indexlibrary{\idxcode{not1}}% -\begin{itemdecl} -template - constexpr unary_negate not1(const Predicate& pred); -\end{itemdecl} - -\begin{itemdescr} -\pnum \returns \tcode{unary_negate(pred)}. -\end{itemdescr} - -\indexlibrary{\idxcode{binary_negate}}% -\indexlibrarymember{first_argument_type}{binary_negate}% -\indexlibrarymember{second_argument_type}{binary_negate}% -\indexlibrarymember{result_type}{binary_negate}% -\begin{codeblock} -template -class binary_negate { -public: - constexpr explicit binary_negate(const Predicate& pred); - constexpr bool operator()(const typename Predicate::first_argument_type& x, - const typename Predicate::second_argument_type& y) const; - using first_argument_type = typename Predicate::first_argument_type; - using second_argument_type = typename Predicate::second_argument_type; - using result_type = bool; - -}; -\end{codeblock} - -\indexlibrarymember{operator()}{binary_negate}% -\begin{itemdecl} -constexpr bool operator()(const typename Predicate::first_argument_type& x, - const typename Predicate::second_argument_type& y) const; -\end{itemdecl} - -\begin{itemdescr} -\pnum \returns \tcode{!pred(x,y)}. -\end{itemdescr} - -\indexlibrary{\idxcode{not2}}% -\begin{itemdecl} -template - constexpr binary_negate not2(const Predicate& pred); -\end{itemdecl} - -\begin{itemdescr} -\pnum \returns \tcode{binary_negate(pred)}. -\end{itemdescr} - -\rSec1[depr.default.allocator]{The default allocator} - -\pnum -The following members and explicit class template specialization are defined in -addition to those specified in \ref{default.allocator}: - -\indexlibrary{\idxcode{allocator}}% -\begin{codeblock} -namespace std { - // specialization for \tcode{void} - template<> class allocator { - public: - using value_type = void; - using pointer = void*; - using const_pointer = const void*; - // reference-to-\tcode{void} members are impossible. - - template struct rebind { using other = allocator; }; - }; - - template class allocator { - public: - using size_type = size_t; - using difference_type = ptrdiff_t; - using pointer = T*; - using const_pointer = const T*; - using reference = T&; - using const_reference = const T&; - template struct rebind { using other = allocator; }; - - T* address(T& x) const noexcept; - const T* address(const T& x) const noexcept; - - T* allocate(size_t n, const void* hint); - - template - void construct(U* p, Args&&... args); - template - void destroy(U* p); - - size_t max_size() const noexcept; - }; -} -\end{codeblock} - -\indexlibrarymember{address}{allocator}% -\begin{itemdecl} -T* address(T& x) const noexcept; -const T* address(const T& x) const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns \tcode{addressof(x)}. -\end{itemdescr} - -\indexlibrarymember{allocate}{allocator}% -\begin{itemdecl} -T* allocate(size_t n, const void* hint); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -A pointer to the initial element of an array of storage of size \tcode{n} -\tcode{* sizeof(T)}, aligned appropriately for objects of type \tcode{T}. -It is \impldef{support for over-aligned types} whether over-aligned types are -supported\iref{basic.align}. - -\pnum -\remarks -The storage is obtained by calling \tcode{::operator new(std::size_t)}\iref{new.delete}, -but it is unspecified when or how often this function is called. - -\pnum -\throws -\tcode{bad_alloc} if the storage cannot be obtained. -\end{itemdescr} - -\indexlibrarymember{construct}{allocator}% -\begin{itemdecl} -template - void construct(U* p, Args&&... args); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -As if by: \tcode{::new((void *)p) U(std::forward(args)...);} -\end{itemdescr} - -\indexlibrarymember{destroy}{allocator}% -\begin{itemdecl} -template - void destroy(U* p); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -As if by \tcode{p->\~{}U()}. -\end{itemdescr} - -\indexlibrarymember{max_size}{allocator}% -\begin{itemdecl} -size_t max_size() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -The largest value \textit{N} for which the call \tcode{allocate(N, 0)} -might succeed. -\end{itemdescr} - -\rSec1[depr.storage.iterator]{Raw storage iterator} - -\pnum -The header -\indexhdr{memory}% -\tcode{} has the following addition: - -\indexlibrary{\idxcode{raw_storage_iterator}}% -\begin{codeblock} -namespace std { - template - class raw_storage_iterator { - public: - using iterator_category = output_iterator_tag; - using value_type = void; - using difference_type = void; - using pointer = void; - using reference = void; - - explicit raw_storage_iterator(OutputIterator x); - - raw_storage_iterator& operator*(); - raw_storage_iterator& operator=(const T& element); - raw_storage_iterator& operator=(T&& element); - raw_storage_iterator& operator++(); - raw_storage_iterator operator++(int); - OutputIterator base() const; - }; -} -\end{codeblock} - -\pnum -\tcode{raw_storage_iterator} is provided to enable algorithms to store their -results into uninitialized memory. The template parameter -\tcode{OutputIterator} is required to have its \tcode{operator*} return an -object for which \tcode{operator\&} is defined and returns a pointer to -\tcode{T}, and is also required to satisfy the requirements of an output -iterator\iref{output.iterators}. - -\indexlibrary{\idxcode{raw_storage_iterator}!constructor}% -\begin{itemdecl} -explicit raw_storage_iterator(OutputIterator x); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes the iterator to point to the same value to which \tcode{x} points. -\end{itemdescr} - -\indexlibrarymember{operator*}{raw_storage_iterator}% -\begin{itemdecl} -raw_storage_iterator& operator*(); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -\tcode{*this} -\end{itemdescr} - -\indexlibrarymember{operator=}{raw_storage_iterator}% -\begin{itemdecl} -raw_storage_iterator& operator=(const T& element); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\requires -\tcode{T} shall be \tcode{CopyConstructible}. - -\pnum -\effects -Constructs a value from \tcode{element} at the location to which the iterator points. - -\pnum -\returns -A reference to the iterator. -\end{itemdescr} - -\indexlibrarymember{operator=}{raw_storage_iterator}% -\begin{itemdecl} -raw_storage_iterator& operator=(T&& element); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\requires -\tcode{T} shall be \tcode{MoveConstructible}. - -\pnum -\effects -Constructs a value from \tcode{std::move(element)} at the location to which -the iterator points. - -\pnum -\returns -A reference to the iterator. -\end{itemdescr} - -\indexlibrarymember{operator++}{raw_storage_iterator}% -\begin{itemdecl} -raw_storage_iterator& operator++(); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Pre-increment: advances the iterator and returns a reference to the updated iterator. -\end{itemdescr} - -\indexlibrarymember{operator++}{raw_storage_iterator}% -\begin{itemdecl} -raw_storage_iterator operator++(int); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Post-increment: advances the iterator and returns the old value of the iterator. -\end{itemdescr} - -\indexlibrarymember{base}{raw_storage_iterator}% -\begin{itemdecl} -OutputIterator base() const; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -An iterator of type \tcode{OutputIterator} that points to the same value as -\tcode{*this} points to. -\end{itemdescr} - -\rSec1[depr.temporary.buffer]{Temporary buffers} - -\pnum -The header -\indexhdr{memory}% -\tcode{} has the following additions: - -\begin{codeblock} -namespace std { - template - pair get_temporary_buffer(ptrdiff_t n) noexcept; - template - void return_temporary_buffer(T* p); -} -\end{codeblock} - -\indexlibrary{\idxcode{get_temporary_buffer}}% -\begin{itemdecl} -template - pair get_temporary_buffer(ptrdiff_t n) noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Obtains a pointer to uninitialized, contiguous storage for $N$ adjacent -objects of type \tcode{T}, for some non-negative number $N$. -It is \impldef{support for over-aligned types} whether over-aligned types are -supported\iref{basic.align}. - -\pnum -\remarks -Calling \tcode{get_temporary_buffer} with a positive number \tcode{n} is -a non-binding request to return storage for \tcode{n} objects of type \tcode{T}. -In this case, an implementation is permitted to return instead storage for -a non-negative number $N$ of such objects, -where \tcode{$N$ != n} (including \tcode{$N$ == 0}). -\begin{note} The request is non-binding to allow latitude for -implementation-specific optimizations of its memory management. \end{note} - -\pnum -\returns -If \tcode{n <= 0} or if no storage could be obtained, -returns a pair \tcode{P} such that -\tcode{P.first} is a null pointer value and \tcode{P.second == 0}; -otherwise returns a pair \tcode{P} such that -\tcode{P.first} refers to the address of the uninitialized storage and -\tcode{P.second} refers to its capacity $N$ (in the units of \tcode{sizeof(T)}). -\end{itemdescr} - -\indexlibrary{\idxcode{return_temporary_buffer}}% -\begin{itemdecl} -template void return_temporary_buffer(T* p); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Deallocates the storage referenced by \tcode{p}. - -\pnum -\requires -\tcode{p} shall be a pointer value returned by an earlier call to -\tcode{get_temporary_buffer} that has not been invalidated by -an intervening call to \tcode{return_temporary_buffer(T*)}. - -\pnum -\throws -Nothing. -\end{itemdescr} - \rSec1[depr.meta.types]{Deprecated type traits} \pnum @@ -2218,13 +1331,6 @@ \indexlibrary{\idxcode{is_literal_type}}% \begin{codeblock} namespace std { - template struct is_literal_type; - template inline constexpr bool is_literal_type_v = is_literal_type::value; - - template struct result_of; // not defined - template struct result_of; - template using result_of_t = typename result_of::type; - template struct is_pod; template inline constexpr bool is_pod_v = is_pod::value; } @@ -2235,39 +1341,6 @@ any of the templates defined in this subclause is undefined, unless explicitly permitted by the specification of the corresponding template. -\begin{itemdecl} -template struct is_literal_type; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\requires -\tcode{remove_all_extents_t} shall be a complete type or \cv{}~\tcode{void}. - -\pnum -\tcode{is_literal_type} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts} -with a base characteristic of \tcode{true_type} -if \tcode{T} is a literal type\iref{basic.types}, and -\tcode{false_type} otherwise. -\end{itemdescr} - -\begin{itemdecl} -template struct result_of; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\requires -\tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} shall be complete types, -\cv{}~\tcode{void}, or arrays of unknown bound. - -\pnum -The partial specialization \tcode{result_of} is a -\tcode{TransformationTrait}\iref{meta.rqmts} whose member typedef \tcode{type} is defined -if and only if \tcode{invoke_result::type}\iref{func.invoke} is defined. -If \tcode{type} is defined, it names the same type as \tcode{invoke_result_t}. -\end{itemdescr} - \begin{itemdecl} template struct is_pod; \end{itemdecl} @@ -2343,31 +1416,6 @@ \end{codeblock} \end{example} -\rSec1[depr.util.smartptr.shared.obs]{Deprecated \tcode{shared_ptr} observers} - -\pnum -The following member is defined in addition to those members specified -in \ref{util.smartptr.shared}: - -\indexlibrary{\idxcode{shared_ptr}}% -\begin{codeblock} -namespace std { - template class shared_ptr { - public: - bool unique() const noexcept; - }; -} -\end{codeblock} - -\indexlibrarymember{unique}{shared_ptr}% -\begin{itemdecl} -bool unique() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum\returns \tcode{use_count() == 1}. -\end{itemdescr} - \rSec1[depr.util.smartptr.shared.atomic]{Deprecated \tcode{shared_ptr} atomic access} \pnum diff --git a/source/iostreams.tex b/source/iostreams.tex index dbd758ae05..a3d3b2cfe0 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1105,7 +1105,9 @@ class ios_base::Init { public: Init(); + Init(const Init&) = default; ~Init(); + Init& operator=(const Init&) = default; private: static int init_cnt; // \expos }; diff --git a/source/iterators.tex b/source/iterators.tex index 94d66d08b6..b472cda2de 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2576,6 +2576,7 @@ istream_iterator(istream_type& s); istream_iterator(const istream_iterator& x) = default; ~istream_iterator() = default; + istream_iterator& operator=(const istream_iterator&) = default; const T& operator*() const; const T* operator->() const; @@ -2794,6 +2795,7 @@ ostream_iterator(ostream_type& s, const charT* delimiter); ostream_iterator(const ostream_iterator& x); ~ostream_iterator(); + ostream_iterator& operator=(const ostream_iterator&) = default; ostream_iterator& operator=(const T& value); ostream_iterator& operator*(); @@ -2964,6 +2966,7 @@ istreambuf_iterator(istream_type& s) noexcept; istreambuf_iterator(streambuf_type* s) noexcept; istreambuf_iterator(const proxy& p) noexcept; + istreambuf_iterator& operator=(const istreambuf_iterator&) noexcept = default; charT operator*() const; istreambuf_iterator& operator++(); proxy operator++(int); diff --git a/source/lib-intro.tex b/source/lib-intro.tex index ef60de47d6..a3637f23e0 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1161,35 +1161,32 @@ \tcode{}\indextext{\idxhdr{threads.h}!absence thereof}.} \begin{multicolfloattable}{\Cpp{} headers for C library facilities}{tab:cpp.c.headers} -{lllll} +{lllllll} \tcode{} \\ -\tcode{} \\ \tcode{} \\ \tcode{} \\ +\columnbreak \tcode{} \\ \tcode{} \\ -\columnbreak \tcode{} \\ -\tcode{} \\ +\columnbreak \tcode{} \\ \tcode{} \\ \tcode{} \\ -\tcode{} \\ \columnbreak +\tcode{} \\ \tcode{} \\ -\tcode{} \\ \tcode{} \\ -\tcode{} \\ +\columnbreak \tcode{} \\ \tcode{} \\ -\columnbreak \tcode{} \\ +\columnbreak \tcode{} \\ \tcode{} \\ -\tcode{} \\ \tcode{} \\ -\tcode{} \\ \columnbreak +\tcode{} \\ \tcode{} \\ \tcode{} \\ \end{multicolfloattable} @@ -1225,7 +1222,7 @@ \pnum Identifiers that are keywords or operators in \Cpp{} shall not be defined as macros in \Cpp{} standard library headers.\footnote{In particular, including the -standard header \tcode{} or \tcode{} has no effect.} +standard header \tcode{} has no effect.} \pnum \ref{depr.c.headers}, C standard library headers, describes the effects of using @@ -1354,7 +1351,6 @@ include at least the headers shown in \tref{cpp.headers.freestanding}. \begin{libsumtab}{\Cpp{} headers for freestanding implementations}{tab:cpp.headers.freestanding} - & & \tcode{} \\ \rowsep \ref{support.types} & Types & \tcode{} \\ \rowsep \ref{support.limits} & Implementation properties & \tcode{} \tcode{} \tcode{} \tcode{} \\ \rowsep \ref{cstdint} & Integer types & \tcode{} \\ \rowsep @@ -1367,7 +1363,6 @@ \ref{meta} & Type traits & \tcode{} \\ \rowsep \ref{bit} & Bit manipulation & \tcode{} \\ \rowsep \ref{atomics} & Atomics & \tcode{} \\ \rowsep -\ref{depr.cstdalign.syn}, \ref{depr.cstdbool.syn} & Deprecated headers & \tcode{} \tcode{} \\ \end{libsumtab} \pnum @@ -2405,7 +2400,9 @@ In namespace \tcode{std}, the following names are reserved for previous standardization: \begin{itemize} \item \indexlibrary{\idxcode{auto_ptr}!zombie} \tcode{auto_ptr}, +\item \indexlibrary{\idxcode{auto_ptr_ref}!zombie} \tcode{auto_ptr_ref}, \item \indexlibrary{\idxcode{binary_function}!zombie} \tcode{binary_function}, +\item \indexlibrary{\idxcode{binary_negate}!zombie} \tcode{binary_negate}, \item \indexlibrary{\idxcode{bind1st}!zombie} \tcode{bind1st}, \item \indexlibrary{\idxcode{bind2nd}!zombie} \tcode{bind2nd}, \item \indexlibrary{\idxcode{binder1st}!zombie} \tcode{binder1st}, @@ -2414,24 +2411,58 @@ \item \indexlibrary{\idxcode{const_mem_fun1_t}!zombie} \tcode{const_mem_fun1_t}, \item \indexlibrary{\idxcode{const_mem_fun_ref_t}!zombie} \tcode{const_mem_fun_ref_t}, \item \indexlibrary{\idxcode{const_mem_fun_t}!zombie} \tcode{const_mem_fun_t}, +\item \indexlibrary{\idxcode{get_temporary_buffer}!zombie} \tcode{get_temporary_buffer}, \item \indexlibrary{\idxcode{get_unexpected}!zombie} \tcode{get_unexpected}, +\item \indexlibrary{\idxcode{gets}!zombie} \tcode{gets}, +\item \indexlibrary{\idxcode{is_literal_type}!zombie} \tcode{is_literal_type}, +\item \indexlibrary{\idxcode{is_literal_type_v}!zombie} \tcode{is_literal_type_v}, \item \indexlibrary{\idxcode{mem_fun1_ref_t}!zombie} \tcode{mem_fun1_ref_t}, \item \indexlibrary{\idxcode{mem_fun1_t}!zombie} \tcode{mem_fun1_t}, \item \indexlibrary{\idxcode{mem_fun_ref_t}!zombie} \tcode{mem_fun_ref_t}, \item \indexlibrary{\idxcode{mem_fun_ref}!zombie} \tcode{mem_fun_ref}, \item \indexlibrary{\idxcode{mem_fun_t}!zombie} \tcode{mem_fun_t}, \item \indexlibrary{\idxcode{mem_fun}!zombie} \tcode{mem_fun}, +\item \indexlibrary{\idxcode{not1}!zombie} \tcode{not1}, +\item \indexlibrary{\idxcode{not2}!zombie} \tcode{not2}, \item \indexlibrary{\idxcode{pointer_to_binary_function}!zombie} \tcode{pointer_to_binary_function}, \item \indexlibrary{\idxcode{pointer_to_unary_function}!zombie} \tcode{pointer_to_unary_function}, \item \indexlibrary{\idxcode{ptr_fun}!zombie} \tcode{ptr_fun}, \item \indexlibrary{\idxcode{random_shuffle}!zombie} \tcode{random_shuffle}, +\item \indexlibrary{\idxcode{raw_storage_iterator}!zombie} \tcode{raw_storage_iterator}, +\item \indexlibrary{\idxcode{result_of}!zombie} \tcode{result_of}, +\item \indexlibrary{\idxcode{result_of_t}!zombie} \tcode{result_of_t}, +\item \indexlibrary{\idxcode{return_temporary_buffer}!zombie} \tcode{return_temporary_buffer}, \item \indexlibrary{\idxcode{set_unexpected}!zombie} \tcode{set_unexpected}, \item \indexlibrary{\idxcode{unary_function}!zombie} \tcode{unary_function}, +\item \indexlibrary{\idxcode{unary_negate}!zombie} \tcode{unary_negate}, +\item \indexlibrary{\idxcode{uncaught_exception}!zombie} \tcode{uncaught_exception}, \item \indexlibrary{\idxcode{unexpected}!zombie} \tcode{unexpected}, and \item \indexlibrary{\idxcode{unexpected_handler}!zombie} \tcode{unexpected_handler}. \end{itemize} +\pnum +The following names are reserved as member types for previous standardization, +and may not be used as a name for object-like macros in portable code: +\begin{itemize} +\item \indexlibrary{\idxcode{argument_type}!zombie} \tcode{argument_type}, +\item \indexlibrary{\idxcode{first_argument_type}!zombie} \tcode{first_argument_type}, +\item \indexlibrary{\idxcode{io_state}!zombie} \tcode{io_state}, +\item \indexlibrary{\idxcode{open_mode}!zombie} \tcode{open_mode}, +\item \indexlibrary{\idxcode{second_argument_type}!zombie} \tcode{second_argument_type}, +and +\item \indexlibrary{\idxcode{seek_dir}!zombie} \tcode{seek_dir}, +\end{itemize} + +\pnum +The name \indexlibrary{\idxcode{stossc}!zombie} \tcode{stossc} is reserved as a +member function for previous standardization, and may not be used as a name for +function-like macros in portable code. + +\pnum +The header names \tcode{}, \tcode{}, \tcode{}, +\tcode{}, and \tcode{} are reserved for previous standardization. + \rSec4[macro.names]{Macro names} \pnum diff --git a/source/numerics.tex b/source/numerics.tex index f5545dd408..b29314c4e0 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -437,6 +437,7 @@ public: using value_type = float; + constexpr complex(const complex&) = default; constexpr complex(float re = 0.0f, float im = 0.0f); constexpr explicit complex(const complex&); constexpr explicit complex(const complex&); @@ -464,6 +465,7 @@ public: using value_type = double; + constexpr complex(const complex&) = default; constexpr complex(double re = 0.0, double im = 0.0); constexpr complex(const complex&); constexpr explicit complex(const complex&); @@ -491,6 +493,7 @@ public: using value_type = long double; + constexpr complex(const complex&) = default; constexpr complex(long double re = 0.0L, long double im = 0.0L); constexpr complex(const complex&); constexpr complex(const complex&); diff --git a/source/utilities.tex b/source/utilities.tex index 4a3fc6ae02..e020f661dd 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -5668,7 +5668,8 @@ reference() noexcept; public: - ~reference() noexcept; + reference(const reference&) = default; + ~reference(); reference& operator=(bool x) noexcept; // for \tcode{b[i] = x;} reference& operator=(const reference&) noexcept; // for \tcode{b[i] = b[j];} bool operator~() const noexcept; // flips the bit @@ -7477,13 +7478,18 @@ \indexlibrary{\idxcode{allocator}}% \indexlibrarymember{value_type}{allocator}% +\indexlibrarymember{size_type}{allocator}% +\indexlibrarymember{difference_type}{allocator}% \indexlibrarymember{propagate_on_container_move_assignment}{allocator}% \indexlibrarymember{is_always_equal}{allocator}% +\indexlibrarymember{operator=}{allocator}% \begin{codeblock} namespace std { template class allocator { public: using value_type = T; + using size_type = size_t; + using difference_type = ptrdiff_t; using propagate_on_container_move_assignment = true_type; using is_always_equal = true_type; @@ -7491,6 +7497,7 @@ constexpr allocator(const allocator&) noexcept; template constexpr allocator(const allocator&) noexcept; ~allocator(); + allocator& operator=(const allocator&) = default; [[nodiscard]] T* allocate(size_t n); void deallocate(T* p, size_t n); @@ -11174,14 +11181,18 @@ The \tcode{memory_resource} class is an abstract interface to an unbounded set of classes encapsulating memory resources. \indexlibrary{\idxcode{memory_resource}}% +\indexlibrarymember{operator=}{memory_resource}% \begin{codeblock} namespace std::pmr { class memory_resource { static constexpr size_t max_align = alignof(max_align_t); // \expos public: + memory_resource(const memory_resource&) = default; virtual ~memory_resource(); + memory_resource& operator=(const memory_resource&) = default; + [[nodiscard]] void* allocate(size_t bytes, size_t alignment = max_align); void deallocate(void* p, size_t bytes, size_t alignment = max_align); diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index a3e2b64a83..8cc7551d76 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -117,6 +117,23 @@ \removedxref{unord.set.swap} \removedxref{unord.multiset.swap} +% Deprecated features were removed. +\removedxref{depr.except.spec} +\removedxref{depr.cpp.headers} +\removedxref{depr.ccomplex.syn} +\removedxref{depr.cstdalign.syn} +\removedxref{depr.cstdbool.syn} +\removedxref{depr.ctgmath.syn} +\removedxref{depr.uncaught} +\removedxref{depr.func.adaptor.binding} +\removedxref{depr.weak.result_type} +\removedxref{depr.func.adaptor.typedefs} +\removedxref{depr.negators} +\removedxref{depr.default.allocator} +\removedxref{depr.storage.iterator} +\removedxref{depr.temporary.buffer} +\removedxref{depr.util.smartptr.shared.obs} + % Deprecated features. %\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref) From 3e80cd4c07563639a8ca55d41d704701ae6d0eb4 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 16:07:09 -0700 Subject: [PATCH 02/33] [complex.special] Reorder defaulted complex copy constructor to emphasize relationship between it and the converting constructors. --- source/numerics.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index b29314c4e0..6acbd5d540 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -437,8 +437,8 @@ public: using value_type = float; - constexpr complex(const complex&) = default; constexpr complex(float re = 0.0f, float im = 0.0f); + constexpr complex(const complex&) = default; constexpr explicit complex(const complex&); constexpr explicit complex(const complex&); @@ -465,9 +465,9 @@ public: using value_type = double; - constexpr complex(const complex&) = default; constexpr complex(double re = 0.0, double im = 0.0); constexpr complex(const complex&); + constexpr complex(const complex&) = default; constexpr explicit complex(const complex&); constexpr double real() const; @@ -493,10 +493,10 @@ public: using value_type = long double; - constexpr complex(const complex&) = default; constexpr complex(long double re = 0.0L, long double im = 0.0L); constexpr complex(const complex&); constexpr complex(const complex&); + constexpr complex(const complex&) = default; constexpr long double real() const; constexpr void real(long double); From fd244b515387efde9fb08ffe183985a38e93d184 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 16:29:19 -0700 Subject: [PATCH 03/33] [diff.cpp03.language.support] Remove change described in p1, which is no longer a possible change. It is not possible to write a global replacement operator new or operator delete in C++20 with code that is also valid C++03, because a) operator new must be declared 'throw(std::bad_alloc)' in C++03 and must be declared with no exception specification in C++11 onwards, and b) operator delete must be declared 'throw()' in C++03 and must be declared 'noexcept' in C++20 onwards. Therefore there is no code that is valid in C++03 and C++20 and changes meaning due to the change identified in this section. Instead, expand [diff.cpp03.language.support]p2 to explain that the affected programs are simply not valid in C++20. --- source/compatibility.tex | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 21e12edad4..e63b303dc0 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1119,40 +1119,6 @@ \rSec2[diff.cpp03.language.support]{\ref{language.support}: language support library} -\diffref{new.delete.single} -\change Linking \tcode{new} and \tcode{delete} operators. -\rationale The two throwing single-object signatures of \tcode{operator new} and -\tcode{operator delete} are now specified to form the base functionality for -the other operators. This clarifies that replacing just these two signatures -changes others, even if they are not explicitly changed. -\effect -Valid \CppIII{} code that replaces global \tcode{new} or \tcode{delete} -operators may execute differently in this International Standard. For -example, the following program should write \tcode{"custom deallocation"} twice, -once for the single-object delete and once for the array delete. - -\begin{codeblock} -#include -#include -#include - -void* operator new(std::size_t size) throw(std::bad_alloc) { - return std::malloc(size); -} - -void operator delete(void* ptr) throw() { - std::puts("custom deallocation"); - std::free(ptr); -} - -int main() { - int* i = new int; - delete i; // single-object delete - int* a = new int[3]; - delete [] a; // array delete -} -\end{codeblock} - \diffref{new.delete.single} \change \tcode{operator new} may throw exceptions other than \tcode{std::bad_alloc}. @@ -1161,6 +1127,10 @@ Valid \CppIII{} code that assumes that global \tcode{operator new} only throws \tcode{std::bad_alloc} may execute differently in this International Standard. +Valid \CppIII{} code that replaces the global replaceable \tcode{operator new} +is ill-formed in this International Standard, +because the exception specification of \tcode{throw(std::bad_alloc)} +was removed. \rSec2[diff.cpp03.diagnostics]{\ref{diagnostics}: diagnostics library} From 043ee628bc8accbe7f1ac4dc2210e88186bc95a4 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 16:41:51 -0700 Subject: [PATCH 04/33] [diff.cpp17.except] Add a note that there is no longer a way to write code that is non-throwing in both C++20 and C++03. --- source/compatibility.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index e63b303dc0..fe5b8ab12f 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1966,6 +1966,13 @@ for its exception specification will be rejected as ill-formed in this International Standard. It should simply be replaced with \tcode{noexcept} for no change of meaning since \CppXVII{}. +\begin{note} +There is no way to write a function declaration +that is non-throwing in this International Standard +and is also non-throwing in \CppIII{} +except by using the preprocessor to generate +a different token sequence in each case. +\end{note} \rSec2[diff.cpp17.library]{\ref{library}: library introduction} From 9e80b6c69467fb2fb146637e1f0fca8b7495250f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 16:59:45 -0700 Subject: [PATCH 05/33] [diff.cpp17.except] Fix Rationale to be a rationale. "This was retained for one additional C++ standard to ease transition" is not a rationale for removing the feature now. --- source/compatibility.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index fe5b8ab12f..d4534bf90f 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1958,8 +1958,7 @@ \diffref{except.spec} \change Remove \tcode{throw()} exception specification. \rationale -The empty dynamic exception specification was retained for one additional \Cpp{} -Standard to ease the transition away from this feature. +Removal of obsolete feature that has been replaced by \tcode{noexcept}. \effect A valid \CppXVII{} function declaration, member function declaration, function pointer declaration, or function reference declaration that uses \tcode{throw()} From fa04176c01dd10105eec6590407b2c76384f5c52 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 17:06:40 -0700 Subject: [PATCH 06/33] [diff.cpp17.library] Fix list of new headers compared to C++17. --- source/compatibility.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index d4534bf90f..690966fe87 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1980,7 +1980,10 @@ \rationale New functionality. \effect The following \Cpp{} headers are new: +\tcode{}, \tcode{}, +\tcode{}, +\tcode{}, \tcode{}, \tcode{}, and \tcode{}. From cf0749742b9318143505f9ffe2d4dabb5420d727 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 17:17:41 -0700 Subject: [PATCH 07/33] [diff.cpp17.library] Fix description of how to adjust code for the removal of and . --- source/compatibility.tex | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 690966fe87..fc8eedfd03 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2001,7 +2001,23 @@ \tcode{}, \tcode{}, and \tcode{}. -The \tcode{\#include} directives can simply be removed with no loss of meaning. +To retain the same behavior: +\begin{itemize} +\item +a \tcode{\#include} of \tcode{} can be replaced by +a \tcode{\#include} of \tcode{}\iref{complex.syn}, +\item +a \tcode{\#include} of \tcode{} can be replaced by +a \tcode{\#include} of \tcode{}\iref{cmath.syn} and +a \tcode{\#include} of \tcode{}, +and +\item +a \tcode{\#include} of +\tcode{}, +\tcode{}, or +\tcode{} +can simply be removed. +\end{itemize} \rSec2[diff.cpp17.containers]{\ref{containers}: containers library} From 577dee51f5b31c6235fc8dd8c9aab6860af17400 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 17:26:59 -0700 Subject: [PATCH 08/33] [diff.cpp17.depr] Add paragraph numbering and fix whitespace. --- source/compatibility.tex | 8 ++++++++ source/macros.tex | 2 ++ 2 files changed, 10 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index fc8eedfd03..5f0c44ea71 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1766,6 +1766,7 @@ \rSec2[diff.cpp14.depr]{\ref{depr}: compatibility features} +\nodiffref \change The class templates \tcode{auto_ptr}, @@ -1784,6 +1785,7 @@ \effect Valid \CppXIV{} code that uses these class templates and function templates may fail to compile in this International Standard. +\nodiffref \change Remove old iostreams members [depr.ios.members]. \rationale Redundant feature for compatibility with pre-standard code @@ -2033,6 +2035,7 @@ \rSec2[diff.cpp17.depr]{\ref{depr}: compatibility features} +\nodiffref \change Remove \tcode{uncaught_exception}. \rationale The function did not have a clear specification when multiple exceptions were @@ -2042,6 +2045,7 @@ to compile. It might be revised to use \tcode{std::uncaught_exceptions} instead, for clear and portable semantics. +\nodiffref \change Remove support for adaptable function API. \rationale The deprecated support relied on a limited convention that could not be @@ -2056,6 +2060,7 @@ class templates \tcode{unary_negate} or \tcode{binary_negate}, may fail to compile. +\nodiffref \change Remove redundant members from \tcode{std::allocator}. \rationale \tcode{std::allocator} was overspecified, encouraging direct usage in user containers @@ -2067,6 +2072,7 @@ \tcode{max_size} members of \tcode{std::allocator}, or that directly calls \tcode{allocate} with an additional hint argument, may fail to compile. +\nodiffref \change Remove \tcode{raw_memory_iterator}. \rationale The iterator encouraged use of algorithms that might throw exceptions, but did @@ -2075,6 +2081,7 @@ \effect A valid \CppXVII{} program that uses this iterator class may fail to compile. +\nodiffref \change Remove temporary buffers API. \rationale The temporary buffer facility was intended to provide an efficient optimization @@ -2085,6 +2092,7 @@ A valid \CppXVII{} program that calls \tcode{get_temporary_buffer} or \tcode{return_temporary_buffer} may fail to compile. +\nodiffref \change Remove \tcode{shared_ptr::unique}. \rationale The result of a call to this member function is not reliable in the presence of diff --git a/source/macros.tex b/source/macros.tex index 32c461df4f..69d35baaf1 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -327,6 +327,8 @@ \newcommand{\diffdef}[1]{\hfill\break\textbf{#1:}\space} \newcommand{\diffref}[1]{\pnum\textbf{Affected subclause:} \ref{#1}} \newcommand{\diffrefs}[2]{\pnum\textbf{Affected subclauses:} \ref{#1}, \ref{#2}} +% \nodiffref swallows a following \change and removes the preceding line break. +\def\nodiffref\change{\pnum\textbf{Change:}\space} \newcommand{\change}{\diffdef{Change}} \newcommand{\rationale}{\diffdef{Rationale}} \newcommand{\effect}{\diffdef{Effect on original feature}} From 16b35d651de53654321b584eba2c6c4e126eb7d8 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 22 Jun 2018 18:08:26 -0700 Subject: [PATCH 09/33] [depr.c.headers] Undo P0619R4's removal of synopses for , , , and . Instead, repurpose these to be synopses for , , , and , and move them into [depr.c.headers]. Also introduce a synopsis for . This avoids three of these five headers being specified as equivalent to a non-existent header, and the other two missing a synopsis. --- source/compatibility.tex | 16 ++-- source/future.tex | 169 ++++++++++++++++++++++++++++++--------- source/xrefdelta.tex | 10 ++- 3 files changed, 150 insertions(+), 45 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 5f0c44ea71..cdad050453 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2134,11 +2134,11 @@ in~\ref{depr.c.headers}, but their use is deprecated in \Cpp{}. \pnum -There are no \Cpp{} headers for the C headers +There are no \Cpp{} headers for the C standard library's headers \tcode{}\indextext{\idxhdr{stdatomic.h}!absence thereof}, \tcode{}\indextext{\idxhdr{stdnoreturn.h}!absence thereof}, and \tcode{}\indextext{\idxhdr{threads.h}!absence thereof}, -nor are the C headers themselves part of \Cpp{}. +nor are these headers from the C standard library headers themselves part of \Cpp{}. \pnum The C headers \tcode{}\indexhdr{complex.h} and @@ -2196,21 +2196,27 @@ and \tcode{xor_eq} are keywords in this International -Standard\iref{lex.key}. +Standard\iref{lex.key}, +and are not introduced as macros +by \tcode{}\iref{depr.iso646.h.syn}. \rSec3[diff.header.stdalign.h]{Header \tcode{}} \indexhdr{stdalign.h}% \pnum The token \tcode{alignas} is a keyword in this International -Standard\iref{lex.key}. +Standard\iref{lex.key}, +and is not introduced as a macro +by \tcode{}\iref{depr.stdalign.h.syn}. \rSec3[diff.header.stdbool.h]{Header \tcode{}} \indexhdr{stdbool.h}% \pnum The tokens \tcode{bool}, \tcode{true}, and \tcode{false} -are keywords in this International Standard\iref{lex.key}. +are keywords in this International Standard\iref{lex.key}, +and are not introduced as macros +by \tcode{}\iref{depr.stdbool.h.syn}. \rSec3[diff.null]{Macro \tcode{NULL}} diff --git a/source/future.tex b/source/future.tex index 44ef2d5fb7..9a5c01a3c6 100644 --- a/source/future.tex +++ b/source/future.tex @@ -110,57 +110,155 @@ C standard library, the \Cpp{} standard library provides the \defnx{C headers}{headers!C library} shown in \tref{future.c.headers}. -\begin{floattable}{C headers}{tab:future.c.headers} +\begin{multicolfloattable}{C headers}{tab:future.c.headers} {lllll} -\topline +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\columnbreak +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\columnbreak +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\columnbreak +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\tcode{} \\ +\columnbreak +\tcode{} \\ +\tcode{} \\ +\end{multicolfloattable} + +\rSec2[depr.complex.h.syn]{Header \tcode{} synopsis} + +\indexhdr{complex.h}% +\begin{codeblock} +#include +\end{codeblock} + +\pnum +The header \tcode{} +behaves as if it simply includes the header +\tcode{}\iref{complex.syn}. + +\pnum +\begin{note} +Names introduced by \tcode{} in namespace \tcode{std} +are not placed into the global namespace scope by \tcode{}. +\end{note} + +\rSec2[depr.iso646.h.syn]{Header \tcode{} synopsis} + +\indexhdr{iso646.h}% +\pnum +The \Cpp{} header \tcode{} is empty. +\begin{note} +\tcode{and}, +\tcode{and_eq}, +\tcode{bitand}, +\tcode{bitor}, +\tcode{compl}, +\tcode{not_eq}, +\tcode{not}, +\tcode{or}, +\tcode{or_eq}, +\tcode{xor}, and +\tcode{xor_eq} +are keywords in this International Standard\iref{lex.key}. +\end{note} + +\rSec2[depr.stdalign.h.syn]{Header \tcode{} synopsis} + +\indexlibrary{\idxcode{__alignas_is_defined}}% +\indexhdr{stdalign.h}% +\begin{codeblock} +#define @\xname{alignas_is_defined}@ 1 +\end{codeblock} + +\pnum +\indexhdr{stdalign.h}% +The contents of the \Cpp{} header \tcode{} are the same as the C +standard library header \tcode{}, with the following changes: +The header \tcode{} does not +define a macro named \tcode{alignas}. + +\xrefc{7.15} -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} \\ +\rSec2[depr.stdbool.h.syn]{Header \tcode{} synopsis} -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} \\ +\indexhdr{stdbool.h}% +\indexlibrary{\idxcode{__bool_true_false_are_defined}}% +\begin{codeblock} +#define @\xname{bool_true_false_are_defined}@ 1 +\end{codeblock} + +\pnum +\indexhdr{stdbool.h}% +The contents of the \Cpp{} header \tcode{} are the same as the C +standard library header \tcode{}, with the following changes: +The header \tcode{} does not +define macros named \tcode{bool}, \tcode{true}, or \tcode{false}. -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & \\ +\xrefc{7.18} -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & \\ +\rSec2[depr.tgmath.h.syn]{Header \tcode{} synopsis} -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & \\ +\indexhdr{tgmath.h}% +\begin{codeblock} +#include +#include +\end{codeblock} -\tcode{} & -\tcode{} & -\tcode{} & -\tcode{} & \\ +\pnum +The header \tcode{} +behaves as if it simply includes the headers +\tcode{}\iref{cmath.syn} and +\tcode{}\iref{complex.syn}. -\end{floattable} +\pnum +\begin{note} The overloads provided in C by type-generic macros are already +provided in \tcode{} and \tcode{} by ``sufficient'' additional +overloads.\end{note} \pnum -The header \tcode{} behaves as if it simply includes the header \tcode{}\iref{complex.syn}. -The header \tcode{} behaves as if it simply includes the headers \tcode{}\iref{complex.syn} -and \tcode{}\iref{cmath.syn}. +\begin{note} +Names introduced by \tcode{} or \tcode{} +in namespace \tcode{std} +are not placed into the global namespace scope by \tcode{}. +\end{note} + +\rSec2[depr.c.headers.other]{Other C headers} \pnum -Every other C header, each of +Every C header +other than +\tcode{}, +\tcode{}, +\tcode{}, +\tcode{}, and +\tcode{}, +each of which has a name of the form \indextext{header!C}% -\tcode{name.h}, +\tcode{<\placeholder{name}.h>}, behaves as if each name placed in the standard library namespace by the corresponding -\tcode{c\textit{name}} +\tcode{} header is placed within the global namespace scope, except for the functions described in \ref{sf.cmath}, @@ -188,7 +286,6 @@ much as in the C Standard. It may also provide these names within the namespace \tcode{std}. \end{example} - \rSec1[depr.relops]{Relational operators} \pnum diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 8cc7551d76..c2fb1b2370 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -120,10 +120,6 @@ % Deprecated features were removed. \removedxref{depr.except.spec} \removedxref{depr.cpp.headers} -\removedxref{depr.ccomplex.syn} -\removedxref{depr.cstdalign.syn} -\removedxref{depr.cstdbool.syn} -\removedxref{depr.ctgmath.syn} \removedxref{depr.uncaught} \removedxref{depr.func.adaptor.binding} \removedxref{depr.weak.result_type} @@ -134,6 +130,12 @@ \removedxref{depr.temporary.buffer} \removedxref{depr.util.smartptr.shared.obs} +% Deprecated headers were removed for some headers +\movedxref{depr.ccomplex.syn}{depr.complex.h.syn} +\movedxref{depr.cstdalign.syn}{depr.stdalign.h.syn} +\movedxref{depr.cstdbool.syn}{depr.stdbool.h.syn} +\movedxref{depr.ctgmath.syn}{depr.tgmath.h.syn} + % Deprecated features. %\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref) From 643152ddf89f697abe8ac57ec57562a9a3f94e72 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 13 Jun 2018 04:28:24 -0700 Subject: [PATCH 10/33] [P0898R3] Standard Library Concepts: rename "old" concepts Prefix the names of all named library requirement sets with "Cpp98" by annotating with new "\oldconcept" macro. Note that not all of these are called out by name in the proposal. The intent is to prefix *all* named library requirements, as discussed in LEWG/LWG. Includes: * Allocator * BasicLockable * BidirectionalIterator * BinaryTypeTrait * Clock * CopyAssignable * CopyConstructible * CopyInsertable * DefaultConstructible * DefaultInsertable * Destructible * EmplaceConstructible * EqualityComparable * Erasable * ForwardIterator * Hash * InputIterator * Iterator * LessThanComparable * Lockable * MoveAssignable * MoveConstructible * MoveInsertable * NullablePointer * OutputIterator * RandomAccessIterator * TimedLockable * TransformationTrait * TrivialClock * UnaryTypeTrait * ValueSwappable --- source/algorithms.tex | 172 +++++++++++++-------------- source/containers.tex | 270 +++++++++++++++++++++--------------------- source/future.tex | 10 +- source/iostreams.tex | 14 +-- source/iterators.tex | 60 +++++----- source/lib-intro.tex | 100 ++++++++-------- source/locales.tex | 3 +- source/macros.tex | 3 + source/numerics.tex | 72 +++++------ source/regex.tex | 19 +-- source/strings.tex | 6 +- source/support.tex | 4 +- source/threads.tex | 70 +++++------ source/utilities.tex | 255 +++++++++++++++++++-------------------- 14 files changed, 534 insertions(+), 524 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index d4a86a4473..788adb5bf6 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -1146,39 +1146,39 @@ or \tcode{Input\-Iterator2}, the template argument shall satisfy the -requirements of an input iterator\iref{input.iterators}. +\oldconcept{InputIterator} requirements\iref{input.iterators}. \item If an algorithm's template parameter is named \tcode{OutputIterator}, \tcode{OutputIterator1}, or \tcode{Output\-Iterator2}, -the template argument shall satisfy the requirements -of an output iterator\iref{output.iterators}. +the template argument shall satisfy the +\oldconcept{OutputIterator} requirements\iref{output.iterators}. \item If an algorithm's template parameter is named \tcode{ForwardIterator}, \tcode{ForwardIterator1}, or \tcode{Forward\-Iterator2}, -the template argument shall satisfy the requirements -of a forward iterator\iref{forward.iterators}. +the template argument shall satisfy the +\oldconcept{ForwardIterator} requirements\iref{forward.iterators}. \item If an algorithm's template parameter is named \tcode{BidirectionalIterator}, \tcode{Bidirectional\-Iterator1}, or \tcode{BidirectionalIterator2}, -the template argument shall satisfy the requirements -of a bidirectional iterator\iref{bidirectional.iterators}. +the template argument shall satisfy the +\oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \item If an algorithm's template parameter is named \tcode{RandomAccessIterator}, \tcode{Random\-AccessIterator1}, or \tcode{RandomAccessIterator2}, -the template argument shall satisfy the requirements -of a random-access iterator\iref{random.access.iterators}. +the template argument shall satisfy the +\oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}. \end{itemize} \pnum @@ -1648,9 +1648,9 @@ \begin{itemdescr} \pnum \requires \tcode{Function} shall satisfy the -\tcode{MoveConstructible} requirements (\tref{moveconstructible}). +\oldconcept{MoveConstructible} requirements (\tref{moveconstructible}). \begin{note} \tcode{Function} need not meet the requirements of -\tcode{CopyConstructible} (\tref{copyconstructible}). \end{note} +\oldconcept{CopyConstructible} (\tref{copyconstructible}). \end{note} \pnum \effects @@ -1692,7 +1692,7 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{Function} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects @@ -1730,9 +1730,9 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \tcode{MoveConstructible} requirements +\tcode{Function} shall satisfy the \oldconcept{MoveConstructible} requirements \begin{note} \tcode{Function} need not meet the requirements of -\tcode{CopyConstructible}. \end{note} +\oldconcept{CopyConstructible}. \end{note} \pnum \requires @@ -1766,7 +1766,7 @@ \begin{itemdescr} \pnum \requires -\tcode{Function} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{Function} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \requires @@ -2190,7 +2190,7 @@ \tcode{InputIterator1} and \tcode{InputIterator2} -meet the requirements of random access iterators\iref{random.access.iterators} +meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and \tcode{last1 - first1 != last2 - first2}, then @@ -2210,7 +2210,7 @@ \tcode{ForwardIterator1} and \tcode{ForwardIterator2} -meet the requirements of random access iterators and +meet the \oldconcept{RandomAccessIterator} requirements and \tcode{last1 - first1 != last2 - first2}, then no applications of the corresponding predicate; otherwise, @@ -2400,7 +2400,7 @@ \pnum \remarks -\tcode{Searcher} need not meet the \tcode{CopyConstructible} requirements. +\tcode{Searcher} need not meet the \oldconcept{CopyConstructible} requirements. \end{itemdescr} @@ -2496,7 +2496,7 @@ \begin{note} For the overload with an \tcode{ExecutionPolicy}, there may be a performance cost if \tcode{iterator_traits::value_type} is not -\tcode{Move\-Constructible} (\tref{moveconstructible}). +\oldconcept{\-Move\-Constructible} (\tref{moveconstructible}). \end{note} \pnum @@ -3038,7 +3038,7 @@ \requires The type of \tcode{*first} -shall satisfy the \tcode{MoveAssignable} +shall satisfy the \oldconcept{MoveAssignable} requirements (\tref{moveassignable}). \pnum @@ -3108,7 +3108,7 @@ \begin{note} For the overloads with an \tcode{ExecutionPolicy}, there may be a performance cost if \tcode{iterator_traits::value_type} is not -\tcode{Move\-Constructible} (\tref{moveconstructible}). +\oldconcept{Move\-Constructible} (\tref{moveconstructible}). \end{note} \pnum @@ -3158,7 +3158,7 @@ \requires The comparison function shall be an equivalence relation. The type of \tcode{*first} shall satisfy the -\tcode{MoveAssignable} requirements (\tref{moveassignable}). +\oldconcept{MoveAssignable} requirements (\tref{moveassignable}). \pnum \effects @@ -3231,17 +3231,17 @@ \item For the overloads with no \tcode{ExecutionPolicy}, let \tcode{T} be the value type of \tcode{InputIterator}. -If \tcode{InputIterator} meets the forward iterator requirements, +If \tcode{InputIterator} meets the \oldconcept{ForwardIterator} requirements, then there are no additional requirements for \tcode{T}. -Otherwise, if \tcode{OutputIterator} meets the forward iterator +Otherwise, if \tcode{OutputIterator} meets the \oldconcept{ForwardIterator} requirements and its value type is the same as \tcode{T}, -then \tcode{T} shall be \tcode{CopyAssignable} (\tref{copyassignable}). +then \tcode{T} shall be \oldconcept{CopyAssignable} (\tref{copyassignable}). Otherwise, \tcode{T} shall be both -\tcode{CopyConstructible} (\tref{copyconstructible}) and \tcode{CopyAssignable}. +\oldconcept{CopyConstructible} (\tref{copyconstructible}) and \oldconcept{CopyAssignable}. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, there may be a performance cost if the value type of \tcode{ForwardIterator1} is not both -\tcode{CopyConstructible} and \tcode{CopyAssignable}. +\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable}. \end{note} \end{itemize} @@ -3283,7 +3283,7 @@ \pnum \requires \tcode{BidirectionalIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. \pnum \effects @@ -3367,9 +3367,9 @@ \range{middle}{last} shall be valid ranges. \tcode{ForwardIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy -the \tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy +the \oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -3455,12 +3455,12 @@ \requires \begin{itemize} \item -\tcode{PopulationIterator} shall satisfy the requirements of an input iterator\iref{input.iterators}. +\tcode{PopulationIterator} shall satisfy the \oldconcept{InputIterator} requirements\iref{input.iterators}. \item -\tcode{SampleIterator} shall satisfy the requirements of an output iterator\iref{output.iterators}. +\tcode{SampleIterator} shall satisfy the \oldconcept{OutputIterator} requirements\iref{output.iterators}. \item -\tcode{SampleIterator} shall satisfy the additional requirements of a random access iterator\iref{random.access.iterators} -unless \tcode{PopulationIterator} satisfies the additional requirements of a forward iterator\iref{forward.iterators}. +\tcode{SampleIterator} shall satisfy the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} +unless \tcode{Pop\-ulat\-ion\-Iter\-ator} satisfies the \oldconcept{ForwardIterator} requirements\iref{forward.iterators}. \item \tcode{PopulationIterator}'s value type shall be writable\iref{iterator.requirements.general} to \tcode{out}. \item @@ -3496,7 +3496,7 @@ \begin{itemize} \item Stable if and only if \tcode{PopulationIterator} satisfies the -requirements of a forward iterator. +\oldconcept{ForwardIterator} requirements. \item To the extent that the implementation of this function makes use of random numbers, the object \tcode{g} shall serve as the @@ -3518,7 +3518,7 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type \tcode{remove_reference_t} shall satisfy the requirements of a @@ -3778,10 +3778,10 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -3816,10 +3816,10 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -3867,10 +3867,10 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -3929,10 +3929,10 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*result_first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{Move\-Assignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{\-Move\-Assignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -4068,10 +4068,10 @@ \pnum \requires \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -4380,7 +4380,7 @@ \pnum \requires \tcode{ForwardIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. \pnum \effects Places all the elements in the range \range{first}{last} that satisfy \tcode{pred} before all the elements that do not satisfy it. @@ -4395,7 +4395,7 @@ \begin{itemize} \item For the overload with no \tcode{ExecutionPolicy}, exactly $N$ applications of the predicate. At most $N / 2$ swaps if \tcode{ForwardIterator} meets the -\tcode{BidirectionalIterator} requirements and at most $N$ swaps otherwise. +\oldconcept{BidirectionalIterator} requirements and at most $N$ swaps otherwise. \item For the overload with an \tcode{ExecutionPolicy}, \bigoh{N \log N} swaps and \bigoh{N} applications of the predicate. \end{itemize} @@ -4417,10 +4417,10 @@ \pnum \requires \tcode{BidirectionalIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -4479,19 +4479,19 @@ \begin{itemize} \item For the overload with no \tcode{ExecutionPolicy}, \tcode{InputIterator}'s -value type shall be \tcode{CopyAssignable} (\tref{copyassignable}), +value type shall be \oldconcept{\-Copy\-Assign\-able} (\tref{copyassignable}), and shall be writable\iref{iterator.requirements.general} to the \tcode{out_true} -and \tcode{out_false} \tcode{OutputIterator}s, and shall be convertible to +and \tcode{out_false} \tcode{Output\-Iter\-ator}s, and shall be convertible to \tcode{Predicate}'s argument type. \item For the overload with an \tcode{ExecutionPolicy}, \tcode{ForwardIterator}'s -value type shall be \tcode{Copy\-Assign\-able}, and shall be writable to the +value type shall be \oldconcept{\-Copy\-Assign\-able}, and shall be writable to the \tcode{out_true} and \tcode{out_false} \tcode{ForwardIterator}s, and shall be convertible to \tcode{Predicate}'s argument type. \begin{note} There may be a performance cost if \tcode{ForwardIterator}'s value type is not -\tcode{CopyConstructible}. +\oldconcept{CopyConstructible}. \end{note} \item @@ -4618,10 +4618,10 @@ The ranges \range{first}{middle} and \range{middle}{last} shall be sorted with respect to \tcode{operator<} or \tcode{comp}. \tcode{BidirectionalIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -5032,9 +5032,9 @@ \range{first}{last - 1} shall be a valid heap. The type of \tcode{*first} shall satisfy -the \tcode{MoveConstructible} requirements +the \oldconcept{MoveConstructible} requirements (\tref{moveconstructible}) and the -\tcode{MoveAssignable} requirements +\oldconcept{MoveAssignable} requirements (\tref{moveassignable}). \pnum @@ -5070,10 +5070,10 @@ \range{first}{last} shall be a valid non-empty heap. \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum @@ -5107,9 +5107,9 @@ \begin{itemdescr} \pnum \requires The type of \tcode{*first} shall satisfy -the \tcode{MoveConstructible} requirements +the \oldconcept{MoveConstructible} requirements (\tref{moveconstructible}) and the -\tcode{MoveAssignable} requirements +\oldconcept{MoveAssignable} requirements (\tref{moveassignable}). \pnum @@ -5140,10 +5140,10 @@ \pnum \requires The range \range{first}{last} shall be a valid heap. \tcode{RandomAccessIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. The type +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. The type of \tcode{*first} shall satisfy the -\tcode{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}) requirements. +\oldconcept{MoveConst\-ruct\-ible} (\tref{moveconstructible}) and +\oldconcept{MoveAssignable} (\tref{moveassignable}) requirements. \pnum \effects @@ -5261,7 +5261,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\tcode{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -5286,8 +5286,8 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{CopyConstructible} and \tcode{t.size() > 0}. -For the first form, type \tcode{T} shall be \tcode{LessThanComparable}. +\requires \tcode{T} shall be \oldconcept{CopyConstructible} and \tcode{t.size() > 0}. +For the first form, type \tcode{T} shall be \oldconcept{LessThanComparable}. \pnum \returns The smallest value in the initializer list. @@ -5311,7 +5311,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\tcode{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -5336,8 +5336,8 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{CopyConstructible} and \tcode{t.size() > 0}. -For the first form, type \tcode{T} shall be \tcode{LessThanComparable}. +\requires \tcode{T} shall be \oldconcept{CopyConstructible} and \tcode{t.size() > 0}. +For the first form, type \tcode{T} shall be \oldconcept{LessThanComparable}. \pnum \returns The largest value in the initializer list. @@ -5362,7 +5362,7 @@ \pnum \requires For the first form, type \tcode{T} shall be -\tcode{LessThanComparable} (\tref{lessthancomparable}). +\oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -5389,8 +5389,8 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{CopyConstructible} and \tcode{t.size() > 0}. -For the first form, type \tcode{T} shall be \tcode{LessThanComparable}. +\requires \tcode{T} shall be \oldconcept{CopyConstructible} and \tcode{t.size() > 0}. +For the first form, type \tcode{T} shall be \oldconcept{LessThanComparable}. \pnum \returns \tcode{pair(x, y)}, where \tcode{x} has the smallest and \tcode{y} has the @@ -5546,7 +5546,7 @@ \requires The value of \tcode{lo} shall be no greater than \tcode{hi}. For the first form, type \tcode{T} -shall be \tcode{LessThan\-Comparable} (\tref{lessthancomparable}). +shall be \oldconcept{LessThan\-Comparable} (\tref{lessthancomparable}). \pnum \returns @@ -5742,7 +5742,7 @@ \pnum \requires \tcode{BidirectionalIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. \pnum \effects @@ -5784,7 +5784,7 @@ \pnum \requires \tcode{BidirectionalIterator} shall satisfy the -\tcode{ValueSwappable} requirements\iref{swappable.requirements}. +\oldconcept{ValueSwappable} requirements\iref{swappable.requirements}. \pnum \effects diff --git a/source/containers.tex b/source/containers.tex index a2c68cd581..e295d1f067 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -98,7 +98,7 @@ \tcode{X::value_type} & \tcode{T} & & - \requires\ \tcode{T} is \tcode{Erasable} from \tcode{X} (see~\ref{container.requirements.general}, below) & + \requires\ \tcode{T} is \oldconcept{Erasable} from \tcode{X} (see~\ref{container.requirements.general}, below) & compile time \\ \rowsep \tcode{X::reference} & @@ -155,7 +155,7 @@ \tcode{X(a)} & & & - \requires \tcode{T} is \tcode{CopyInsertable} + \requires \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X} (see below).\br \postconditions \tcode{a == X(a)}. & linear \\ \rowsep @@ -163,7 +163,7 @@ \tcode{X u = a;} & & & - \requires \tcode{T} is \tcode{CopyInsertable} + \requires \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X} (see below).\br \postconditions \tcode{u == a} & linear \\ \rowsep @@ -217,7 +217,7 @@ convertible to \tcode{bool} & \tcode{==} is an equivalence relation. \tcode{equal(\brk{}a.begin(), a.end(), b.begin(), b.end())} & - \requires\ \tcode{T} is \tcode{EqualityCompar\-a\-ble} & + \requires\ \tcode{T} is \oldconcept{\-Equal\-ity\-Compar\-a\-ble} & Constant if \tcode{a.size() != b.size()}, linear otherwise \\ \rowsep @@ -318,7 +318,7 @@ All other constructors for these container types take a \tcode{const allocator_type\&} argument. \begin{note} If an invocation of a constructor uses the default value of an optional -allocator argument, then the \tcode{Allocator} type must support value-initialization. +allocator argument, then the allocator type must support value-initialization. \end{note} A copy of this allocator is used for any memory allocation and element construction performed, by these constructors and by all member functions, @@ -527,8 +527,8 @@ \begin{itemize} \item -\tcode{T} is \defnx{\tcode{DefaultInsertable} into \tcode{X}} -{DefaultInsertable into X@\tcode{DefaultInsertable} into \tcode{X}} +\tcode{T} is \defnx{\oldconcept{DefaultInsertable} into \tcode{X}} +{\oldconcept{DefaultInsertable} into X@\oldconcept{DefaultInsertable} into \tcode{X}} means that the following expression is well-formed: \begin{codeblock} allocator_traits::construct(m, p) @@ -544,8 +544,8 @@ allocated within \tcode{X}. \item -\tcode{T} is \defnx{\tcode{MoveInsertable} into \tcode{X}} -{MoveInsertable into X@\tcode{MoveInsertable} into \tcode{X}} +\tcode{T} is \defnx{\oldconcept{MoveInsertable} into \tcode{X}} +{\oldconcept{MoveInsertable} into X@\oldconcept{MoveInsertable} into \tcode{X}} means that the following expression is well-formed: \begin{codeblock} @@ -556,9 +556,9 @@ \begin{note} \tcode{rv} remains a valid object. Its state is unspecified \end{note} \item -\tcode{T} is \defnx{\tcode{CopyInsertable} into \tcode{X}} -{CopyInsertable into X@\tcode{CopyInsertable} into \tcode{X}} -means that, in addition to \tcode{T} being \tcode{MoveInsertable} into +\tcode{T} is \defnx{\oldconcept{CopyInsertable} into \tcode{X}} +{\oldconcept{CopyInsertable} into X@\oldconcept{CopyInsertable} into \tcode{X}} +means that, in addition to \tcode{T} being \oldconcept{MoveInsertable} into \tcode{X}, the following expression is well-formed: \begin{codeblock} allocator_traits::construct(m, p, v) @@ -568,8 +568,8 @@ \item \tcode{T} is -\defnx{\tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}} -{EmplaceConstructible into X from args@\tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}}, +\defnx{\oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}} +{\oldconcept{EmplaceConstructible} into X from args@\oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}}, for zero or more arguments \tcode{args}, means that the following expression is well-formed: \begin{codeblock} @@ -578,8 +578,8 @@ \item \tcode{T} is -\defnx{\tcode{Erasable} from \tcode{X}} -{Erasable from X@\tcode{Erasable} from \tcode{X}} +\defnx{\oldconcept{Erasable} from \tcode{X}} +{\oldconcept{Erasable} from X@\oldconcept{Erasable} from \tcode{X}} means that the following expression is well-formed: \begin{codeblock} allocator_traits::destroy(m, p) @@ -632,7 +632,7 @@ \tcode{X()}\br \tcode{X u;} & & - \requires\ \tcode{A} is \tcode{DefaultConstructible}.\br + \requires\ \tcode{A} is \oldconcept{DefaultConstructible}.\br \postconditions \tcode{u.empty()} returns \tcode{true}, \tcode{u.get_allocator() == A()} & constant \\ \rowsep @@ -649,7 +649,7 @@ \tcode{X(t, m)}\br \tcode{X u(t, m);} & & -\requires\ \tcode{T} is \tcode{CopyInsertable} into \tcode{X}.\br +\requires\ \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}.\br \postconditions \tcode{u == t}, \tcode{u.get_allocator() == m} & linear \\ \rowsep @@ -666,7 +666,7 @@ \tcode{X u(rv, m);} & & \requires\ \tcode{T} is - \tcode{MoveInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}.\br \postconditions \tcode{u} shall have the same elements, or copies of the elements, that \tcode{rv} had before this construction, \tcode{u.get_allocator() == m} & @@ -675,8 +675,8 @@ \tcode{a = t} & \tcode{X\&} & \requires\ \tcode{T} is - \tcode{CopyInsertable} into \tcode{X} - and \tcode{CopyAssignable}.\br + \oldconcept{CopyInsertable} into \tcode{X} + and \oldconcept{CopyAssignable}.\br \postconditions \tcode{a == t} & linear \\ \rowsep @@ -687,8 +687,8 @@ \tcode{::propagate_on_container_-}\br \tcode{move_assignment::value} is\br \tcode{false}, \tcode{T} is - \tcode{MoveInsertable} into \tcode{X} and - \tcode{MoveAssignable}. All existing elements of \tcode{a} + \oldconcept{MoveInsertable} into \tcode{X} and + \oldconcept{MoveAssignable}. All existing elements of \tcode{a} are either move assigned to or destroyed.\br \postconditions \tcode{a} shall be equal to the value that \tcode{rv} had before this assignment. & @@ -823,18 +823,18 @@ \tcode{X u(n, t);} & & \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{CopyInsertable} into \tcode{X}.\br \postconditions \tcode{distance(begin(), end()) == n}\br Constructs a sequence container with \tcode{n} copies of \tcode{t} \\ \rowsep \tcode{X(i, j)}\br \tcode{X u(i, j);} & & - \requires\ \tcode{T} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}. + \requires\ \tcode{T} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. For \tcode{vector}, if the iterator does - not meet the forward iterator requirements\iref{forward.iterators}, \tcode{T} + not meet the \oldconcept{\-Forward\-Iterator} requirements\iref{forward.iterators}, \tcode{T} shall also be - \tcode{MoveInsertable} into \tcode{X}. + \oldconcept{MoveInsertable} into \tcode{X}. Each iterator in the range \range{i}{j} shall be dereferenced exactly once.\br \postconditions \tcode{distance(begin(), end()) ==} \tcode{distance(i, j)}\br @@ -847,8 +847,8 @@ \tcode{a = il} & \tcode{X\&} & \requires\ \tcode{T} is - \tcode{CopyInsertable} into \tcode{X} - and \tcode{CopyAssignable}. + \oldconcept{CopyInsertable} into \tcode{X} + and \oldconcept{CopyAssignable}. Assigns the range \range{il.begin()}{il.end()} into \tcode{a}. All existing elements of \tcode{a} are either assigned to or destroyed.\br \returns\ \tcode{*this}. @@ -856,9 +856,9 @@ \tcode{a.emplace(p, args)} & \tcode{iterator} & - \requires\ \tcode{T} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}. For \tcode{vector} and \tcode{deque}, + \requires\ \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}. For \tcode{vector} and \tcode{deque}, \tcode{T} is also - \tcode{MoveInsertable} into \tcode{X} and \tcode{MoveAssignable}. + \oldconcept{MoveInsertable} into \tcode{X} and \oldconcept{MoveAssignable}. \effects\ Inserts an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} before \tcode{p}. \begin{note} \tcode{args} may directly or indirectly refer to @@ -868,29 +868,29 @@ \tcode{a.insert(p,t)} & \tcode{iterator} & \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X}. For \tcode{vector} and \tcode{deque}, - \tcode{T} shall also be \tcode{CopyAssignable}.\br + \oldconcept{CopyInsertable} into \tcode{X}. For \tcode{vector} and \tcode{deque}, + \tcode{T} shall also be \oldconcept{CopyAssignable}.\br \effects\ Inserts a copy of \tcode{t} before \tcode{p}. \\ \rowsep \tcode{a.insert(p,rv)} & \tcode{iterator} & \requires\ \tcode{T} shall be - \tcode{MoveInsertable} into \tcode{X}. For \tcode{vector} and \tcode{deque}, - \tcode{T} shall also be \tcode{MoveAssignable}.\br + \oldconcept{MoveInsertable} into \tcode{X}. For \tcode{vector} and \tcode{deque}, + \tcode{T} shall also be \oldconcept{MoveAssignable}.\br \effects\ Inserts a copy of \tcode{rv} before \tcode{p}. \\ \rowsep \tcode{a.insert(p,n,t)} & \tcode{iterator} & \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X} - and \tcode{CopyAssignable}.\br + \oldconcept{CopyInsertable} into \tcode{X} + and \oldconcept{CopyAssignable}.\br Inserts \tcode{n} copies of \tcode{t} before \tcode{p}. \\ \rowsep \tcode{a.insert(p,i,j)} & \tcode{iterator} & - \requires\ \tcode{T} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}. + \requires\ \tcode{T} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. For \tcode{vector} and \tcode{deque}, \tcode{T} shall also be - \tcode{MoveInsertable} into \tcode{X}, \tcode{MoveConstructible}, \tcode{MoveAssignable}, + \oldconcept{MoveInsertable} into \tcode{X}, \oldconcept{MoveConstructible}, \oldconcept{MoveAssignable}, and swappable\iref{swappable.requirements}. Each iterator in the range \range{i}{j} shall be dereferenced exactly once.\br \requires \tcode{i} and \tcode{j} are not iterators into \tcode{a}.\br @@ -903,13 +903,13 @@ \tcode{a.erase(q)} & \tcode{iterator} & \requires\ For \tcode{vector} and \tcode{deque}, - \tcode{T} shall be \tcode{MoveAssignable}.\br + \tcode{T} shall be \oldconcept{MoveAssignable}.\br \effects\ Erases the element pointed to by \tcode{q}. \\ \rowsep \tcode{a.erase(q1,q2)} & \tcode{iterator} & \requires\ For \tcode{vector} and \tcode{deque}, - \tcode{T} shall be \tcode{MoveAssignable}.\br + \tcode{T} shall be \oldconcept{MoveAssignable}.\br \effects\ Erases the elements in the range \tcode{[q1, q2)}. \\ \rowsep \tcode{a.clear()} & @@ -921,11 +921,11 @@ \tcode{a.assign(i,j)} & \tcode{void} & - \requires\ \tcode{T} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i} + \requires\ \tcode{T} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i} and assignable from \tcode{*i}. For \tcode{vector}, if the iterator does not meet the forward iterator requirements\iref{forward.iterators}, \tcode{T} shall also be - \tcode{MoveInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}.\br Each iterator in the range \range{i}{j} shall be dereferenced exactly once.\br \requires \tcode{i}, \tcode{j} are not iterators into \tcode{a}.\br Replaces elements in \tcode{a} with a copy of \tcode{[i, j)}.\br @@ -941,8 +941,8 @@ \tcode{a.assign(n,t)} & \tcode{void} & \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X} - and \tcode{CopyAssignable}.\br + \oldconcept{CopyInsertable} into \tcode{X} + and \oldconcept{CopyAssignable}.\br \requires \tcode{t} is not a reference into \tcode{a}.\br Replaces elements in \tcode{a} with \tcode{n} copies of \tcode{t}.\br Invalidates all references, pointers and iterators @@ -1082,7 +1082,7 @@ \tcode{a.emplace_\-front(args)} & \tcode{reference} & Prepends an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...}.\br - \requires\ \tcode{T} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{T} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \returns{} \tcode{a.front()}. & \tcode{deque}, \tcode{forward_list}, @@ -1092,9 +1092,9 @@ \tcode{a.emplace_\-back(args)} & \tcode{reference} & Appends an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...}.\br - \requires\ \tcode{T} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}. For \tcode{vector}, \tcode{T} + \requires\ \tcode{T} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}. For \tcode{vector}, \tcode{T} shall also be - \tcode{MoveInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}.\br \returns{} \tcode{a.back()}. & \tcode{deque}, \tcode{list}, @@ -1105,7 +1105,7 @@ \tcode{void} & Prepends a copy of \tcode{t}.\br \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X}. + \oldconcept{CopyInsertable} into \tcode{X}. & \tcode{deque}, \tcode{forward_list}, @@ -1116,7 +1116,7 @@ \tcode{void} & Prepends a copy of \tcode{rv}.\br \requires\ \tcode{T} shall be - \tcode{MoveInsertable} into \tcode{X}. + \oldconcept{MoveInsertable} into \tcode{X}. & \tcode{deque}, \tcode{forward_list}, @@ -1127,7 +1127,7 @@ \tcode{void} & Appends a copy of \tcode{t}.\br \requires\ \tcode{T} shall be - \tcode{CopyInsertable} into \tcode{X}. + \oldconcept{CopyInsertable} into \tcode{X}. & \tcode{basic_string}, \tcode{deque}, @@ -1139,7 +1139,7 @@ \tcode{void} & Appends a copy of \tcode{rv}.\br \requires\ \tcode{T} shall be - \tcode{MoveInsertable} into \tcode{X}. + \oldconcept{MoveInsertable} into \tcode{X}. & \tcode{basic_string}, \tcode{deque}, @@ -1575,9 +1575,9 @@ \tcode{map} and \tcode{multimap}, the requirements placed on \tcode{value_type} in \tref{containers.allocatoraware} apply instead to \tcode{key_type} and \tcode{mapped_type}. \begin{note} For example, in some cases \tcode{key_type} and \tcode{mapped_type} -are required to be \tcode{CopyAssignable} even though the associated +are required to be \oldconcept{CopyAssignable} even though the associated \tcode{value_type}, \tcode{pair}, is not -\tcode{CopyAssignable}. \end{note} +\oldconcept{CopyAssignable}. \end{note} \pnum In \tref{containers.associative.requirements}, @@ -1654,17 +1654,17 @@ \tcode{X::value_type} (\tcode{set} and \tcode{multiset} only) & \tcode{Key} & - \requires\ \tcode{value_type} is \tcode{Erasable} from \tcode{X} & + \requires\ \tcode{value_type} is \oldconcept{Erasable} from \tcode{X} & compile time \\ \rowsep \tcode{X::value_type} (\tcode{map} and \tcode{multimap} only) & \tcode{pair} & - \requires\ \tcode{value_type} is \tcode{Erasable} from \tcode{X} & + \requires\ \tcode{value_type} is \oldconcept{Erasable} from \tcode{X} & compile time \\ \rowsep \tcode{X::key_compare} & \tcode{Compare} & - \requires\ \tcode{key_compare} is \tcode{CopyConstructible}. & + \requires\ \tcode{key_compare} is \oldconcept{CopyConstructible}. & compile time \\ \rowsep \tcode{X::value_compare} & @@ -1690,7 +1690,7 @@ \tcode{X()}\br\tcode{X u;} & & - \requires\ \tcode{key_compare} is \tcode{DefaultConstructible}.\br + \requires\ \tcode{key_compare} is \oldconcept{DefaultConstructible}.\br \effects\ Constructs an empty container. Uses \tcode{Compare()} as a comparison object & constant \\ \rowsep @@ -1698,7 +1698,7 @@ \tcode{X(i,j,c)}\br \tcode{X~u(i,j,c);} & & - \requires\ \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br + \requires\ \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Constructs an empty container and inserts elements from the range \tcode{[i, j)} into it; uses \tcode{c} as a comparison object. & $N \log N$ in general, where $N$ has the value \tcode{distance(i, j)}; @@ -1706,8 +1706,8 @@ \tcode{X(i,j)}\br\tcode{X~u(i,j);} & & - \requires\ \tcode{key_compare} is \tcode{DefaultConstructible}. - \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br + \requires\ \tcode{key_compare} is \oldconcept{DefaultConstructible}. + \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Same as above, but uses \tcode{Compare()} as a comparison object. & same as above \\ \rowsep @@ -1724,8 +1724,8 @@ \tcode{a = il} & \tcode{X\&} & \requires\ \tcode{value_type} is - \tcode{CopyInsertable} into \tcode{X} - and \tcode{CopyAssignable}.\br + \oldconcept{CopyInsertable} into \tcode{X} + and \oldconcept{CopyAssignable}.\br \effects Assigns the range \range{il.begin()}{il.end()} into \tcode{a}. All existing elements of \tcode{a} are either assigned to or destroyed. & $N \log N$ in general, where $N$ has the value \tcode{il.size() + a.size()}; @@ -1744,7 +1744,7 @@ \tcode{a_uniq.\brk{}emplace(\brk{}args)} & \tcode{pair<\brk{}iterator, bool>} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \effects\ Inserts a \tcode{value_type} object \tcode{t} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} if and only if there is no element in the container with key equivalent to the key of \tcode{t}. @@ -1756,7 +1756,7 @@ \tcode{a_eq.\brk{}emplace(\brk{}args)} & \tcode{iterator} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \effects\ Inserts a \tcode{value_type} object \tcode{t} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} and returns the iterator pointing to the newly inserted element. @@ -1777,8 +1777,8 @@ \tcode{a_uniq.\brk{}insert(\brk{}t)} & \tcode{pair<\brk{}iterator, bool>} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects\ Inserts \tcode{t} if and only if there is no element in the container with key equivalent to the key of \tcode{t}. The \tcode{bool} component of the returned pair is \tcode{true} if and only if the insertion @@ -1790,8 +1790,8 @@ \tcode{a_eq.\brk{}insert(\brk{}t)} & \tcode{iterator} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects\ Inserts \tcode{t} and returns the iterator pointing to the newly inserted element. If a range containing elements equivalent to @@ -1802,8 +1802,8 @@ \tcode{a.\brk{}insert(\brk{}p, t)} & \tcode{iterator} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects\ Inserts \tcode{t} if and only if there is no element with key equivalent to the key of \tcode{t} in containers with unique keys; always inserts \tcode{t} in containers with equivalent keys. Always @@ -1815,7 +1815,7 @@ \tcode{a.\brk{}insert(\brk{}i, j)} & \tcode{void} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \requires \tcode{i}, \tcode{j} are not iterators into \tcode{a}. inserts each element from the range \range{i}{j} if and only if there is no element with key equivalent to the key of that element in containers @@ -2131,7 +2131,7 @@ \pnum Each unordered associative container is parameterized by \tcode{Key}, -by a function object type \tcode{Hash} that meets the \tcode{Hash} +by a function object type \tcode{Hash} that meets the \oldconcept{Hash} requirements\iref{hash.requirements} and acts as a hash function for argument values of type \tcode{Key}, and by a binary predicate \tcode{Pred} that induces an equivalence relation on values of type \tcode{Key}. @@ -2216,9 +2216,9 @@ \tcode{unordered_map} and \tcode{unordered_multimap}, the requirements placed on \tcode{value_type} in \tref{containers.allocatoraware} apply instead to \tcode{key_type} and \tcode{mapped_type}. \begin{note} For example, \tcode{key_type} and \tcode{mapped_type} -are sometimes required to be \tcode{CopyAssignable} even though the associated +are sometimes required to be \oldconcept{CopyAssignable} even though the associated \tcode{value_type}, \tcode{pair}, is not -\tcode{CopyAssignable}. \end{note} +\oldconcept{CopyAssignable}. \end{note} \pnum \indextext{unordered associative containers}% @@ -2285,12 +2285,12 @@ \tcode{X::value_type} (\tcode{unordered_set} and \tcode{unordered_multiset} only) & \tcode{Key} & - \requires\ \tcode{value_type} is \tcode{Erasable} from \tcode{X} & + \requires\ \tcode{value_type} is \oldconcept{Erasable} from \tcode{X} & compile time \\ \rowsep \tcode{X::value_type} (\tcode{unordered_map} and \tcode{unordered_multimap} only) & \tcode{pair} & - \requires\ \tcode{value_type} is \tcode{Erasable} from \tcode{X} & + \requires\ \tcode{value_type} is \oldconcept{Erasable} from \tcode{X} & compile time \\ \rowsep \indexunordmem{hasher}% @@ -2304,7 +2304,7 @@ \indexunordmem{key_equal}% \tcode{X::key_equal} & \tcode{Pred} -& \requires\ \tcode{Pred} is \tcode{CopyConstructible}.\br +& \requires\ \tcode{Pred} is \oldconcept{CopyConstructible}.\br \tcode{Pred} shall be a binary predicate that takes two arguments of type \tcode{Key}. \tcode{Pred} is an equivalence relation.% & compile time @@ -2350,7 +2350,7 @@ % \tcode{X(n, hf)}\br \tcode{X a(n, hf);} & \tcode{X} -& \requires\ \tcode{key_equal} is \tcode{DefaultConstructible}.\br +& \requires\ \tcode{key_equal} is \oldconcept{DefaultConstructible}.\br \effects\ Constructs an empty container with at least \tcode{n} buckets, using \tcode{hf} as the hash function and \tcode{key_equal()} as the key equality predicate. @@ -2359,7 +2359,7 @@ % \tcode{X(n)}\br \tcode{X a(n);} & \tcode{X} -& \requires\ \tcode{hasher} and \tcode{key_equal} are \tcode{DefaultConstructible}.\br +& \requires\ \tcode{hasher} and \tcode{key_equal} are \oldconcept{DefaultConstructible}.\br \effects\ Constructs an empty container with at least \tcode{n} buckets, using \tcode{hasher()} as the hash function and \tcode{key_equal()} as the key equality predicate. @@ -2368,7 +2368,7 @@ % \tcode{X()}\br \tcode{X a;} & \tcode{X} -& \requires\ \tcode{hasher} and \tcode{key_equal} are \tcode{DefaultConstructible}.\br +& \requires\ \tcode{hasher} and \tcode{key_equal} are \oldconcept{DefaultConstructible}.\br \effects\ Constructs an empty container with an unspecified number of buckets, using \tcode{hasher()} as the hash function and \tcode{key_equal()} as the key equality predicate. @@ -2377,7 +2377,7 @@ % \tcode{X(i, j, n, hf, eq)}\br \tcode{X a(i, j, n, hf, eq);} & \tcode{X} -& \requires\ \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br +& \requires\ \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Constructs an empty container with at least \tcode{n} buckets, using \tcode{hf} as the hash function and \tcode{eq} as the key equality predicate, and inserts elements from \tcode{[i, j)} into it. @@ -2387,8 +2387,8 @@ % \tcode{X(i, j, n, hf)}\br \tcode{X a(i, j, n, hf);} & \tcode{X} -& \requires\ \tcode{key_equal} is \tcode{DefaultConstructible}. - \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br +& \requires\ \tcode{key_equal} is \oldconcept{DefaultConstructible}. + \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Constructs an empty container with at least \tcode{n} buckets, using \tcode{hf} as the hash function and \tcode{key_equal()} as the key equality predicate, and inserts elements from \tcode{[i, j)} into it. @@ -2398,8 +2398,8 @@ % \tcode{X(i, j, n)}\br \tcode{X a(i, j, n);} & \tcode{X} -& \requires\ \tcode{hasher} and \tcode{key_equal} are \tcode{DefaultConstructible}. - \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br +& \requires\ \tcode{hasher} and \tcode{key_equal} are \oldconcept{DefaultConstructible}. + \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Constructs an empty container with at least \tcode{n} buckets, using \tcode{hasher()} as the hash function and \tcode{key_equal()} as the key equality predicate, and inserts elements from \tcode{[i, j)} @@ -2410,8 +2410,8 @@ % \tcode{X(i, j)}\br \tcode{X a(i, j);} & \tcode{X} -& \requires\ \tcode{hasher} and \tcode{key_equal} are \tcode{DefaultConstructible}. - \tcode{value_type} is \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br +& \requires\ \tcode{hasher} and \tcode{key_equal} are \oldconcept{DefaultConstructible}. + \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \effects\ Constructs an empty container with an unspecified number of buckets, using \tcode{hasher()} as the hash function and \tcode{key_equal()} as the key equality predicate, and inserts elements @@ -2463,8 +2463,8 @@ \tcode{a = il} & \tcode{X\&} & \requires\ \tcode{value_type} is -\tcode{CopyInsertable} into \tcode{X} -and \tcode{CopyAssignable}.\br +\oldconcept{CopyInsertable} into \tcode{X} +and \oldconcept{CopyAssignable}.\br \effects\ Assigns the range \range{il.begin()}{il.end()} into \tcode{a}. All existing elements of \tcode{a} are either assigned to or destroyed. & Same as \tcode{a = X(il)}. @@ -2487,7 +2487,7 @@ \tcode{a_uniq.} \tcode{emplace(args)} & \tcode{pair} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \effects\ Inserts a \tcode{value_type} object \tcode{t} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} if and only if there is no element in the container with key equivalent to the key of \tcode{t}. @@ -2500,7 +2500,7 @@ \tcode{a_eq.}\tcode{emplace(args)} & \tcode{iterator} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \effects\ Inserts a \tcode{value_type} object \tcode{t} constructed with \tcode{std::forward<\brk{}Args>(\brk{}args)...} and returns the iterator pointing to the newly inserted element. & @@ -2509,7 +2509,7 @@ \tcode{a.emplace_hint(p, args)} & \tcode{iterator} & - \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br + \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}.\br \effects\ Equivalent to \tcode{a.emplace(} \tcode{std::forward<\brk{}Args>(\brk{}args)...)}. Return value is an iterator pointing to the element with the key equivalent to the newly inserted element. The \tcode{const_iterator} \tcode{p} @@ -2522,8 +2522,8 @@ \tcode{a_uniq.insert(t)} & \tcode{pair} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects\ Inserts \tcode{t} if and only if there is no element in the container with key equivalent to the key of \tcode{t}. The \tcode{bool} component of the returned pair indicates whether the insertion @@ -2535,8 +2535,8 @@ \tcode{a_eq.insert(t)} & \tcode{iterator} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects\ Inserts \tcode{t}, and returns an iterator pointing to the newly inserted element. & Average case \bigoh{1}, worst case \bigoh{\tcode{a_eq.}\br\tcode{size()}}. @@ -2545,8 +2545,8 @@ \tcode{a.insert(p, t)} & \tcode{iterator} & \requires\ If \tcode{t} is a non-const rvalue expression, \tcode{value_type} shall be - \tcode{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be - \tcode{CopyInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}; otherwise, \tcode{value_type} shall be + \oldconcept{CopyInsertable} into \tcode{X}.\br \effects Equivalent to \tcode{a.insert(t)}. Return value is an iterator pointing to the element with the key equivalent to that of \tcode{t}. The iterator \tcode{p} is a hint pointing to where the search should @@ -2556,7 +2556,7 @@ % \tcode{a.insert(i, j)} & \tcode{void} -& \requires\ \tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br +& \requires\ \tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.\br \requires \tcode{i} and \tcode{j} are not iterators in \tcode{a}.\br \effects Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.% & Average case \bigoh{N}, where $N$ is \tcode{distance(i, j)}. @@ -3257,7 +3257,7 @@ conform to the container requirements table in~\ref{container.requirements}. In addition to the requirements specified in the container requirements table, the implicit move constructor and move assignment operator for \tcode{array} -require that \tcode{T} be \tcode{MoveConstructible} or \tcode{MoveAssignable}, +require that \tcode{T} be \oldconcept{MoveConstructible} or \oldconcept{MoveAssignable}, respectively. \begin{itemdecl} @@ -3568,7 +3568,7 @@ \tcode{n} default-inserted elements using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{DefaultInsertable} into \tcode{*this}. \pnum \complexity Linear in \tcode{n}. @@ -3588,7 +3588,7 @@ using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{CopyInsertable} into \tcode{*this}. \pnum \complexity @@ -3628,7 +3628,7 @@ appends \tcode{sz - size()} default-inserted elements to the sequence. \pnum -\requires \tcode{T} shall be \tcode{MoveInsertable} and \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{MoveInsertable} and \oldconcept{DefaultInsertable} into \tcode{*this}. \end{itemdescr} \indexlibrary{\idxcode{resize}!\idxcode{deque}}% @@ -3644,7 +3644,7 @@ \pnum \requires \tcode{T} shall be -\tcode{CopyInsertable} into \tcode{*this}. +\oldconcept{CopyInsertable} into \tcode{*this}. \end{itemdescr} \indexlibrarymember{shrink_to_fit}{deque}% @@ -3654,7 +3654,7 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{MoveInsertable} into \tcode{*this}. \pnum \effects \tcode{shrink_to_fit} is a non-binding request to reduce memory use @@ -3662,7 +3662,7 @@ \begin{note} The request is non-binding to allow latitude for implementation-specific optimizations. \end{note} If an exception is thrown other than by the move constructor -of a non-\tcode{CopyInsertable} \tcode{T} there are no effects. +of a non-\oldconcept{CopyInsertable} \tcode{T} there are no effects. \pnum \complexity Linear in the size of the sequence. @@ -3715,7 +3715,7 @@ If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a -non-\tcode{CopyInsertable} +non-\oldconcept{CopyInsertable} \tcode{T}, the effects are unspecified. \pnum @@ -3944,7 +3944,7 @@ default-inserted elements using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{DefaultInsertable} into \tcode{*this}. \pnum \complexity Linear in \tcode{n}. @@ -3960,7 +3960,7 @@ \effects Constructs a \tcode{forward_list} object with \tcode{n} copies of \tcode{value} using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{CopyInsertable} into \tcode{*this}. \pnum \complexity Linear in \tcode{n}. @@ -4202,7 +4202,7 @@ elements at the end of the list. \pnum -\requires \tcode{T} shall be \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{DefaultInsertable} into \tcode{*this}. \end{itemdescr} \begin{itemdecl} @@ -4216,7 +4216,7 @@ copies of \tcode{c} at the end of the list. \pnum -\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{CopyInsertable} into \tcode{*this}. \end{itemdescr} @@ -4644,7 +4644,7 @@ \tcode{n} default-inserted elements using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{DefaultInsertable} into \tcode{*this}. \pnum \complexity @@ -4669,7 +4669,7 @@ using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{CopyInsertable} into \tcode{*this}. \pnum \complexity @@ -4721,7 +4721,7 @@ \pnum \requires \tcode{T} shall be -\tcode{DefaultInsertable} into \tcode{*this}. +\oldconcept{DefaultInsertable} into \tcode{*this}. \end{itemdescr} \indexlibrary{\idxcode{resize}!\idxcode{list}}% @@ -4746,7 +4746,7 @@ \end{codeblock} \pnum -\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{CopyInsertable} into \tcode{*this}. \end{itemdescr} \rSec3[list.modifiers]{Modifiers} @@ -5297,7 +5297,7 @@ default-inserted elements using the specified allocator. \pnum -\requires \tcode{T} shall be \tcode{DefaultInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{DefaultInsertable} into \tcode{*this}. \pnum \complexity Linear in \tcode{n}. @@ -5316,7 +5316,7 @@ \pnum \requires \tcode{T} shall be -\tcode{CopyInsertable} into \tcode{*this}. +\oldconcept{CopyInsertable} into \tcode{*this}. \pnum \complexity Linear in \tcode{n}. @@ -5379,7 +5379,7 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{MoveInsertable} into \tcode{*this}. \pnum \effects @@ -5397,7 +5397,7 @@ Reallocation happens at this point if and only if the current capacity is less than the argument of \tcode{reserve()}. If an exception is thrown -other than by the move constructor of a non-\tcode{CopyInsertable} type, +other than by the move constructor of a non-\oldconcept{CopyInsertable} type, there are no effects. \pnum @@ -5430,7 +5430,7 @@ \begin{itemdescr} \pnum -\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}. +\requires \tcode{T} shall be \oldconcept{MoveInsertable} into \tcode{*this}. \pnum \effects \tcode{shrink_to_fit} is a non-binding request to reduce @@ -5440,7 +5440,7 @@ It does not increase \tcode{capacity()}, but may reduce \tcode{capacity()} by causing reallocation. If an exception is thrown other than by the move constructor -of a non-\tcode{CopyInsertable} \tcode{T} there are no effects. +of a non-\oldconcept{CopyInsertable} \tcode{T} there are no effects. \pnum \complexity Linear in the size of the sequence. @@ -5485,10 +5485,10 @@ \pnum \requires \tcode{T} shall be -\tcode{MoveInsertable} and \tcode{DefaultInsertable} into \tcode{*this}. +\oldconcept{MoveInsertable} and \oldconcept{DefaultInsertable} into \tcode{*this}. \pnum -\remarks If an exception is thrown other than by the move constructor of a non-\tcode{CopyInsertable} +\remarks If an exception is thrown other than by the move constructor of a non-\oldconcept{CopyInsertable} \tcode{T} there are no effects. \end{itemdescr} @@ -5505,7 +5505,7 @@ \pnum \requires \tcode{T} shall be -\tcode{CopyInsertable} into \tcode{*this}. +\oldconcept{CopyInsertable} into \tcode{*this}. \pnum \remarks If an exception is thrown there are no effects. @@ -5560,9 +5560,9 @@ \tcode{T} or by any \tcode{InputIterator} operation there are no effects. If an exception is thrown while inserting a single element at the end and -\tcode{T} is \tcode{CopyInsertable} or \tcode{is_nothrow_move_constructible_v} +\tcode{T} is \oldconcept{CopyInsertable} or \tcode{is_nothrow_move_constructible_v} is \tcode{true}, there are no effects. -Otherwise, if an exception is thrown by the move constructor of a non-\tcode{CopyInsertable} +Otherwise, if an exception is thrown by the move constructor of a non-\oldconcept{CopyInsertable} \tcode{T}, the effects are unspecified. \pnum @@ -6321,7 +6321,7 @@ \begin{itemdescr} \pnum \requires -\tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{map} +\tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{map} from \tcode{piecewise_construct}, \tcode{for\-ward_as_tuple(k)}, \tcode{forward_as_tuple(std::forward(args)...)}. @@ -6359,7 +6359,7 @@ \begin{itemdescr} \pnum \requires -\tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{map} +\tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{map} from \tcode{piecewise_construct}, \tcode{for\-ward_as_tuple(std::move(k))}, \tcode{forward_as_tuple(std::forward(args)...)}. @@ -6398,7 +6398,7 @@ \pnum \requires \tcode{is_assignable_v} shall be \tcode{true}. -\tcode{value_type} shall be \tcode{Emplace\-Constructible} into \tcode{map} +\tcode{value_type} shall be \oldconcept{Emplace\-Constructible} into \tcode{map} from \tcode{k}, \tcode{forward(obj)}. \pnum @@ -6435,7 +6435,7 @@ \pnum \requires \tcode{is_assignable_v} shall be \tcode{true}. -\tcode{value_type} shall be \tcode{Emplace\-Constructible} into \tcode{map} +\tcode{value_type} shall be \oldconcept{Emplace\-Constructible} into \tcode{map} from \tcode{move(k)}, \tcode{forward(obj)}. \pnum @@ -7819,7 +7819,7 @@ \begin{itemdescr} \pnum \requires -\tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{unordered_map} +\tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{unordered_map} from \tcode{piecewise_con\-struct}, \tcode{forward_as_tuple(k)}, \tcode{forward_as_tuple(std::forward(args)...)}. @@ -7857,7 +7857,7 @@ \begin{itemdescr} \pnum \requires -\tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{unordered_map} +\tcode{value_type} shall be \oldconcept{EmplaceConstructible} into \tcode{unordered_map} from \tcode{piecewise_con\-struct}, \tcode{forward_as_tuple(std::move(k))}, \tcode{forward_as_tuple(std::forward(args)...)}. @@ -7896,7 +7896,7 @@ \pnum \requires \tcode{is_assignable_v} shall be \tcode{true}. -\tcode{value_type} shall be \tcode{Emplace\-Constructible} into \tcode{unordered_map} +\tcode{value_type} shall be \oldconcept{Emplace\-Constructible} into \tcode{unordered_map} from \tcode{k}, \tcode{std::forward(obj)}. \pnum @@ -7933,7 +7933,7 @@ \pnum \requires \tcode{is_assignable_v} shall be \tcode{true}. -\tcode{value_type} shall be \tcode{Emplace\-Constructible} into \tcode{unordered_map} +\tcode{value_type} shall be \oldconcept{Emplace\-Constructible} into \tcode{unordered_map} from \tcode{std::move(k)}, \tcode{std::forward(obj)}. \pnum diff --git a/source/future.tex b/source/future.tex index 9a5c01a3c6..5a3cb3d578 100644 --- a/source/future.tex +++ b/source/future.tex @@ -315,7 +315,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{EqualityComparable} (\tref{equalitycomparable}). +Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{equalitycomparable}). \pnum \returns @@ -330,7 +330,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -345,7 +345,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -360,7 +360,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -1448,7 +1448,7 @@ \tcode{remove_all_extents_t} shall be a complete type or \cv{} \tcode{void}. \pnum -\tcode{is_pod} is a \tcode{UnaryTypeTrait}\iref{meta.rqmts} +\tcode{is_pod} is a \oldconcept{UnaryTypeTrait}\iref{meta.rqmts} with a base characteristic of \tcode{true_type} if \tcode{T} is a POD type, and \tcode{false_type} otherwise. diff --git a/source/iostreams.tex b/source/iostreams.tex index a3d3b2cfe0..d6d15b8c13 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -10441,7 +10441,7 @@ \end{codeblock} \pnum -\tcode{Allocator} shall satisfy the \tcode{Allocator} requirements +\tcode{Allocator} shall satisfy the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \pnum @@ -10773,7 +10773,7 @@ \pnum Template parameters named \tcode{InputIterator} shall satisfy the -input iterator requirements\iref{input.iterators} and shall +\oldconcept{InputIterator} requirements\iref{input.iterators} and shall have a value type that is one of the encoded character types. \pnum @@ -10785,7 +10785,7 @@ \pnum Template parameters named \tcode{Allocator} shall satisfy the -\tcode{Allocator} requirements (\tref{utilities.allocator.requirements}). +\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \rSec3[fs.req.namespace]{Namespaces and headers} @@ -11010,7 +11010,7 @@ \pnum \tcode{\textit{trivial-clock}} is an \impldef{type of filesystem trivial clock} type -that satisfies the \tcode{TrivialClock} requirements\iref{time.clock.req} +that satisfies the \oldconcept{TrivialClock} requirements\iref{time.clock.req} and that is capable of representing and measuring file time values. Implementations should ensure that the resolution and range of \tcode{file_time_type} reflect the operating system dependent resolution and range @@ -11573,7 +11573,7 @@ \item \tcode{basic_string_view}. A function argument \tcode{const Source\&} \tcode{source} shall have an effective range \range{source.begin()}{source.end()}. -\item A type meeting the input iterator requirements that iterates over a NTCTS. +\item A type meeting the \oldconcept{InputIterator} requirements that iterates over a NTCTS. The value type shall be an encoded character type. A function argument \tcode{const Source\&} \tcode{source} shall have an effective range \range{source}{end} where \tcode{end} is the first @@ -13888,8 +13888,8 @@ \end{codeblock} \pnum - \tcode{directory_iterator} satisfies the requirements of an input -iterator\iref{input.iterators}. + \tcode{directory_iterator} satisfies the + \oldconcept{InputIterator} requirements\iref{input.iterators}. \pnum If an iterator of type \tcode{directory_iterator} reports an error or diff --git a/source/iterators.tex b/source/iterators.tex index b472cda2de..0e6242b78f 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -156,7 +156,7 @@ the only exceptions are destroying an iterator that holds a singular value, the assignment of a non-singular value to an iterator that holds a singular value, and, for iterators that satisfy the -\tcode{DefaultConstructible} requirements, using a value-initialized iterator +\oldconcept{DefaultConstructible} requirements, using a value-initialized iterator as the source of a copy or move operation. \begin{note} This guarantee is not offered for default-initialization, although the distinction only matters for types with trivial default constructors such as pointers or aggregates holding pointers. @@ -265,11 +265,11 @@ \begin{note} For an iterator type \tcode{X} there must be an instantiation of \tcode{iterator_traits}\iref{iterator.traits}. \end{note} -\rSec2[iterator.iterators]{Iterator} +\rSec2[iterator.iterators]{\oldconcept{Iterator}} \pnum -The \tcode{Iterator} requirements form the basis of the iterator -taxonomy; every iterator satisfies the \tcode{Iterator} requirements. This +The \oldconcept{Iterator} requirements form the basis of the iterator +taxonomy; every iterator satisfies the \oldconcept{Iterator} requirements. This set of requirements specifies operations for dereferencing and incrementing an iterator. Most algorithms will require additional operations to read\iref{input.iterators} or write\iref{output.iterators} values, or @@ -277,11 +277,11 @@ \ref{bidirectional.iterators}, \ref{random.access.iterators}). \pnum -A type \tcode{X} satisfies the \tcode{Iterator} requirements if: +A type \tcode{X} satisfies the \oldconcept{Iterator} requirements if: \begin{itemize} -\item \tcode{X} satisfies the \tcode{CopyConstructible}, \tcode{CopyAssignable}, and -\tcode{Destructible} requirements\iref{utility.arg.requirements} and lvalues +\item \tcode{X} satisfies the \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, and +\oldconcept{Destructible} requirements\iref{utility.arg.requirements} and lvalues of type \tcode{X} are swappable\iref{swappable.requirements}, and \item the expressions in \tref{iterator.requirements} are valid and have @@ -289,7 +289,7 @@ \end{itemize} \begin{libreqtab4b} -{Iterator requirements} +{\oldconcept{Iterator} requirements} {tab:iterator.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -321,8 +321,8 @@ satisfies the requirements of an input iterator for the value type \tcode{T} if -\tcode{X} satisfies the \tcode{Iterator}\iref{iterator.iterators} and -\tcode{EqualityComparable} (\tref{equalitycomparable}) requirements and +\tcode{X} satisfies the \oldconcept{Iterator}\iref{iterator.iterators} and +\oldconcept{EqualityComparable} (\tref{equalitycomparable}) requirements and the expressions in \tref{iterator.input.requirements} are valid and have the indicated semantics. @@ -356,7 +356,7 @@ \end{example} \begin{libreqtab4b} -{Input iterator requirements (in addition to Iterator)} +{\oldconcept{InputIterator} requirements (in addition to \oldconcept{Iterator})} {tab:iterator.input.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -414,7 +414,7 @@ They should be \term{single pass} algorithms. -Value type \tcode{T} is not required to be a \tcode{CopyAssignable} type (\tref{copyassignable}). +Value type \tcode{T} is not required to be a \oldconcept{CopyAssignable} type (\tref{copyassignable}). These algorithms can be used with istreams as the source of the input data through the \tcode{istream_iterator} class template. @@ -426,12 +426,12 @@ A class or pointer type \tcode{X} satisfies the requirements of an output iterator -if \tcode{X} satisfies the \tcode{Iterator} requirements\iref{iterator.iterators} +if \tcode{X} satisfies the \oldconcept{Iterator} requirements\iref{iterator.iterators} and the expressions in \tref{iterator.output.requirements} are valid and have the indicated semantics. \begin{libreqtab4b} -{Output iterator requirements (in addition to Iterator)} +{\oldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})} {tab:iterator.output.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -494,9 +494,9 @@ satisfies the requirements of a forward iterator if \begin{itemize} -\item \tcode{X} satisfies the requirements of an input iterator\iref{input.iterators}, +\item \tcode{X} satisfies the \oldconcept{InputIterator} requirements\iref{input.iterators}, -\item \tcode{X} satisfies the \tcode{DefaultConstructible} +\item \tcode{X} satisfies the \oldconcept{DefaultConstructible} requirements\iref{utility.arg.requirements}, \item if \tcode{X} is a mutable iterator, \tcode{reference} is a reference to \tcode{T}; @@ -539,7 +539,7 @@ \end{note} \begin{libreqtab4b} -{Forward iterator requirements (in addition to input iterator)} +{\oldconcept{ForwardIterator} requirements (in addition to \oldconcept{InputIterator})} {tab:iterator.forward.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -576,11 +576,11 @@ A class or pointer type \tcode{X} satisfies the requirements of a bidirectional iterator if, -in addition to satisfying the requirements for forward iterators, +in addition to satisfying the \oldconcept{ForwardIterator} requirements, the following expressions are valid as shown in \tref{iterator.bidirectional.requirements}. \begin{libreqtab4b} -{Bidirectional iterator requirements (in addition to forward iterator)} +{\oldconcept{BidirectionalIterator} requirements (in addition to \oldconcept{ForwardIterator})} {tab:iterator.bidirectional.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -621,11 +621,11 @@ A class or pointer type \tcode{X} satisfies the requirements of a random access iterator if, -in addition to satisfying the requirements for bidirectional iterators, +in addition to satisfying the \oldconcept{BidirectionalIterator} requirements, the following expressions are valid as shown in \tref{iterator.random.access.requirements}. \begin{libreqtab4b} -{Random access iterator requirements (in addition to bidirectional iterator)} +{\oldconcept{RandomAccessIterator} requirements (in addition to \oldconcept{BidirectionalIterator})} {tab:iterator.random.access.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -1127,7 +1127,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{InputIterator} meets the requirements of random access iterator, +If \tcode{InputIterator} meets the \oldconcept{RandomAccessIterator} requirements, returns \tcode{(last - first)}; otherwise, returns the number of increments needed to get from \tcode{first} @@ -1136,7 +1136,7 @@ \pnum \requires -If \tcode{InputIterator} meets the requirements of random access iterator, +If \tcode{InputIterator} meets the \oldconcept{RandomAccessIterator} requirements, \tcode{last} shall be reachable from \tcode{first} or \tcode{first} shall be reachable from \tcode{last}; otherwise, \tcode{last} @@ -1261,12 +1261,12 @@ \pnum The template parameter \tcode{Iterator} -shall satisfy all the requirements of a Bidirectional Iterator\iref{bidirectional.iterators}. +shall satisfy all the requirements of a \oldconcept{BidirectionalIterator}\iref{bidirectional.iterators}. \pnum Additionally, \tcode{Iterator} -shall satisfy the requirements of a random access iterator\iref{random.access.iterators} +shall satisfy the requirements of a \oldconcept{RandomAccessIterator}\iref{random.access.iterators} if any of the members \tcode{operator+}, \tcode{operator-}, @@ -2148,11 +2148,11 @@ \pnum The template parameter \tcode{Iterator} shall satisfy -the requirements of an input iterator\iref{input.iterators}. +the \oldconcept{InputIterator} requirements\iref{input.iterators}. Additionally, if any of the bidirectional or random access traversal functions are instantiated, the template parameter shall satisfy the -requirements for a Bidirectional Iterator\iref{bidirectional.iterators} -or a Random Access Iterator\iref{random.access.iterators}, respectively. +\oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators} +or \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}, respectively. \rSec3[move.iter.ops]{\tcode{move_iterator} operations} @@ -2548,8 +2548,8 @@ The behavior of a program that applies \tcode{operator++()} to an end-of-stream iterator is undefined. It is impossible to store things into istream iterators. -The type \tcode{T} shall satisfy the \tcode{DefaultConstructible}, -\tcode{CopyConstructible}, and \tcode{CopyAssignable} requirements. +The type \tcode{T} shall satisfy the \oldconcept{DefaultConstructible}, +\oldconcept{CopyConstructible}, and \oldconcept{CopyAssignable} requirements. \pnum Two end-of-stream iterators are always equal. diff --git a/source/lib-intro.tex b/source/lib-intro.tex index a3637f23e0..da693ac9fb 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -633,12 +633,12 @@ The Requirements subclauses may describe names that are used to specify constraints on template arguments.\footnote{Examples from~\ref{utility.requirements} include: -\tcode{EqualityComparable}, -\tcode{LessThanComparable}, -\tcode{CopyConstructible}. +\oldconcept{EqualityComparable}, +\oldconcept{LessThanComparable}, +\oldconcept{CopyConstructible}. Examples from~\ref{iterator.requirements} include: -\tcode{InputIterator}, -\tcode{ForwardIterator}.} +\oldconcept{InputIterator}, +\oldconcept{ForwardIterator}.} These names are used in library Clauses to describe the types that may be supplied as arguments by a \Cpp{} program when instantiating template components from @@ -924,7 +924,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{EqualityComparable} (\tref{equalitycomparable}). +Type \tcode{T} is \oldconcept{EqualityComparable} (\tref{equalitycomparable}). \pnum \returns @@ -939,7 +939,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -954,7 +954,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -969,7 +969,7 @@ \begin{itemdescr} \pnum \requires -Type \tcode{T} is \tcode{LessThanComparable} (\tref{lessthancomparable}). +Type \tcode{T} is \oldconcept{LessThanComparable} (\tref{lessthancomparable}). \pnum \returns @@ -1502,8 +1502,8 @@ \tcode{T()} shall be a well-defined expression\iref{dcl.init} if one of those signatures is called using the default argument\iref{dcl.fct.default}. -\indextext{requirements!\idxcode{EqualityComparable}}% -\begin{concepttable}{\tcode{EqualityComparable} requirements}{equalitycomparable} +\indextext{requirements!\idxcode{Cpp98EqualityComparable}}% +\begin{concepttable}{\oldconcept{EqualityComparable} requirements}{equalitycomparable} {x{1in}x{1in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \rhdr{Requirement} \\ \capsep @@ -1521,8 +1521,8 @@ \end{itemize} \\ \end{concepttable} -\indextext{requirements!\idxcode{LessThanComparable}}% -\begin{concepttable}{\tcode{LessThanComparable} requirements}{lessthancomparable} +\indextext{requirements!\idxcode{Cpp98LessThanComparable}}% +\begin{concepttable}{\oldconcept{LessThanComparable} requirements}{lessthancomparable} {x{1in}x{1in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Requirement} \\ \capsep @@ -1532,8 +1532,8 @@ \end{concepttable} \enlargethispage{-3\baselineskip} -\indextext{requirements!\idxcode{DefaultConstructible}}% -\begin{concepttable}{\tcode{DefaultConstructible} requirements}{defaultconstructible} +\indextext{requirements!\idxcode{Cpp98DefaultConstructible}}% +\begin{concepttable}{\oldconcept{DefaultConstructible} requirements}{defaultconstructible} {x{2.15in}p{3in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1543,8 +1543,8 @@ or aggregate-initialized \\ \end{concepttable} -\indextext{requirements!\idxcode{MoveConstructible}}% -\begin{concepttable}{\tcode{MoveConstructible} requirements}{moveconstructible} +\indextext{requirements!\idxcode{Cpp98MoveConstructible}}% +\begin{concepttable}{\oldconcept{MoveConstructible} requirements}{moveconstructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1558,8 +1558,8 @@ work as specified whether \tcode{rv} has been moved from or not. \end{note}}\\ \end{concepttable} -\indextext{requirements!\idxcode{CopyConstructible}}% -\begin{concepttable}{\tcode{CopyConstructible} requirements (in addition to \tcode{MoveConstructible})}{copyconstructible} +\indextext{requirements!\idxcode{Cpp98CopyConstructible}}% +\begin{concepttable}{\oldconcept{CopyConstructible} requirements (in addition to \oldconcept{MoveConstructible})}{copyconstructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1568,8 +1568,8 @@ the value of \tcode{v} is unchanged and is equivalent to \tcode{T(v)} \\ \end{concepttable} -\indextext{requirements!\idxcode{MoveAssignable}}% -\begin{concepttable}{\tcode{MoveAssignable} requirements}{moveassignable} +\indextext{requirements!\idxcode{Cpp98MoveAssignable}}% +\begin{concepttable}{\oldconcept{MoveAssignable} requirements}{moveassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep @@ -1584,16 +1584,16 @@ work as specified whether \tcode{rv} has been moved from or not. \end{note}}\\ \end{concepttable} -\indextext{requirements!\idxcode{CopyAssignable}}% -\begin{concepttable}{\tcode{CopyAssignable} requirements (in addition to \tcode{MoveAssignable})}{copyassignable} +\indextext{requirements!\idxcode{Cpp98CopyAssignable}}% +\begin{concepttable}{\oldconcept{CopyAssignable} requirements (in addition to \oldconcept{MoveAssignable})}{copyassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep \tcode{t = v} & \tcode{T\&} & \tcode{t} & \tcode{t} is equivalent to \tcode{v}, the value of \tcode{v} is unchanged\\ \end{concepttable} -\indextext{requirements!\idxcode{Destructible}} -\begin{concepttable}{\tcode{Destructible} requirements}{destructible} +\indextext{requirements!\idxcode{Cpp98Destructible}} +\begin{concepttable}{\oldconcept{Destructible} requirements}{destructible} {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep @@ -1650,7 +1650,7 @@ \pnum A type \tcode{X} satisfying any of the iterator requirements\iref{iterator.requirements} -satisfies the \tcode{ValueSwappable} requirements if, +satisfies the \oldconcept{ValueSwappable} requirements if, for any dereferenceable object \tcode{x} of type \tcode{X}, \tcode{*x} is swappable. @@ -1699,16 +1699,16 @@ \end{codeblock} \end{example} -\rSec3[nullablepointer.requirements]{\tcode{NullablePointer} requirements} +\rSec3[nullablepointer.requirements]{\oldconcept{NullablePointer} requirements} \pnum -A \tcode{NullablePointer} type is a pointer-like type that supports null values. -A type \tcode{P} satisfies the \tcode{Nullable\-Pointer} requirements if: +A \oldconcept{NullablePointer} type is a pointer-like type that supports null values. +A type \tcode{P} satisfies the \oldconcept{\-Nullable\-Pointer} requirements if: \begin{itemize} -\item \tcode{P} satisfies the \tcode{EqualityComparable}, -\tcode{DefaultConstructible}, \tcode{CopyConstructible}, \tcode{CopyAssignable}, -and \tcode{Destructible} requirements, +\item \tcode{P} satisfies the \oldconcept{EqualityComparable}, +\oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, \oldconcept{\-Copy\-Assign\-able}, +and \oldconcept{Destructible} requirements, \item lvalues of type \tcode{P} are swappable\iref{swappable.requirements}, @@ -1730,7 +1730,7 @@ had been evaluated in place of \tcode{p}. \pnum -No operation which is part of the \tcode{NullablePointer} requirements shall exit +No operation which is part of the \oldconcept{NullablePointer} requirements shall exit via an exception. \pnum @@ -1739,8 +1739,8 @@ denote values of type (possibly \tcode{const}) \tcode{P}, and \tcode{np} denotes a value of type (possibly \tcode{const}) \tcode{std::nullptr_t}. -\indextext{requirements!\idxcode{NullablePointer}}% -\begin{concepttable}{\tcode{NullablePointer} requirements}{nullablepointer} +\indextext{requirements!\idxcode{Cpp98NullablePointer}}% +\begin{concepttable}{\oldconcept{NullablePointer} requirements}{nullablepointer} {lll} \topline Expression & Return type & Operational semantics \\ \capsep @@ -1777,16 +1777,16 @@ \\ \rowsep \end{concepttable} -\rSec3[hash.requirements]{Hash requirements} +\rSec3[hash.requirements]{\oldconcept{Hash} requirements} -\indextext{requirements!\idxcode{Hash}} +\indextext{requirements!\idxcode{Cpp98Hash}} \pnum -A type \tcode{H} meets the \tcode{Hash} requirements if: +A type \tcode{H} meets the \oldconcept{Hash} requirements if: \begin{itemize} \item it is a function object type\iref{function.objects}, -\item it satisfies the \tcode{CopyConstructible} (\tref{copyconstructible}) and - \tcode{Destructible} (\tref{destructible}) requirements, and +\item it satisfies the \oldconcept{CopyConstructible} (\tref{copyconstructible}) and + \oldconcept{Destructible} (\tref{destructible}) requirements, and \item the expressions shown in \tref{hash} are valid and have the indicated semantics. \end{itemize} @@ -1797,7 +1797,7 @@ \tcode{u} is an lvalue of type \tcode{Key}, and \tcode{k} is a value of a type convertible to (possibly \tcode{const}) \tcode{Key}. -\begin{concepttable}{\tcode{Hash} requirements}{hash} +\begin{concepttable}{\oldconcept{Hash} requirements}{hash} {llp{.55\hsize}} \topline Expression & Return type & Requirement \\ \capsep @@ -1815,9 +1815,9 @@ Shall not modify \tcode{u}. \\ \end{concepttable} -\rSec3[allocator.requirements]{Allocator requirements} +\rSec3[allocator.requirements]{\oldconcept{Allocator} requirements} -\indextext{requirements!\idxcode{Allocator}}% +\indextext{requirements!\idxcode{Cpp98Allocator}}% \pnum The library describes a standard set of requirements for \term{allocators}, which are class-type objects that encapsulate the information about an allocation model. @@ -1859,8 +1859,8 @@ \lhdr{Variable} & \rhdr{Definition} \\ \capsep \endhead \tcode{T, U, C} & any \cv-unqualified object type\iref{basic.types} \\ \rowsep -\tcode{X} & an Allocator class for type \tcode{T} \\ \rowsep -\tcode{Y} & the corresponding Allocator class for type \tcode{U} \\ \rowsep +\tcode{X} & an allocator class for type \tcode{T} \\ \rowsep +\tcode{Y} & the corresponding allocator class for type \tcode{U} \\ \rowsep \tcode{XX} & the type \tcode{allocator_traits} \\ \rowsep \tcode{YY} & the type \tcode{allocator_traits} \\ \rowsep \tcode{a, a1, a2} & lvalues of type \tcode{X} \\ \rowsep @@ -1886,7 +1886,7 @@ \end{libreqtab2} \begin{libreqtab4d} -{Allocator requirements} +{\oldconcept{Allocator} requirements} {tab:utilities.allocator.requirements} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Assertion/note} & \rhdr{Default} \\ @@ -2099,11 +2099,11 @@ Note B: If \tcode{X::propagate_on_container_copy_assignment::value} is \tcode{true}, \tcode{X} shall satisfy the -\tcode{CopyAssign\-able} requirements (\tref{copyassignable}) +\oldconcept{\-Copy\-Assign\-able} requirements (\tref{copyassignable}) and the copy operation shall not throw exceptions. If \tcode{X::propagate_on_container_move_assignment::value} is \tcode{true}, \tcode{X} shall satisfy the -\tcode{MoveAssignable} requirements (\tref{moveassignable}) +\oldconcept{\-Move\-Assign\-able} requirements (\tref{moveassignable}) and the move operation shall not throw exceptions. If \tcode{X::propagate_on_container_swap::value} is \tcode{true}, lvalues of type \tcode{X} shall be swappable\iref{swappable.requirements} @@ -2111,10 +2111,10 @@ \pnum An allocator type \tcode{X} shall satisfy the -\tcode{CopyConstructible} requirements (\tref{copyconstructible}). +\oldconcept{CopyConstructible} requirements (\tref{copyconstructible}). The \tcode{X::pointer}, \tcode{X::const_pointer}, \tcode{X::void_pointer}, and \tcode{X::const_void_pointer} types shall satisfy the -\tcode{Nullable\-Pointer} requirements (\tref{nullablepointer}). +\oldconcept{Nullable\-Pointer} requirements (\tref{nullablepointer}). No constructor, comparison function, copy operation, move operation, or swap operation on these pointer types shall exit via an exception. \tcode{X::pointer} and \tcode{X::const_pointer} shall also diff --git a/source/locales.tex b/source/locales.tex index 6d3e8ff556..f47093a319 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -440,7 +440,8 @@ \tcode{OutputIterator} indicates the set of all possible specializations on parameters that satisfy the -requirements of an Input Iterator or an Output Iterator, respectively\iref{iterator.requirements}. +\oldconcept{InputIterator} requirements or \oldconcept{OutputIterator} +requirements, respectively\iref{iterator.requirements}. A template parameter with name \tcode{C} represents the set diff --git a/source/macros.tex b/source/macros.tex index 69d35baaf1..ee7fb9176a 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -316,6 +316,9 @@ %% Produces 9 output characters. \newcommand{\commentellip}{\tcode{/* ...\ */}} +%% Concepts +\newcommand{\oldconcept}[1]{\textit{Cpp98#1}} + %% Ranges \newcommand{\Range}[4]{\tcode{#1#3,\penalty2000{} #4#2}} \newcommand{\crange}[2]{\Range{[}{]}{#1}{#2}} diff --git a/source/numerics.tex b/source/numerics.tex index 6acbd5d540..b83c0b538c 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -2201,8 +2201,8 @@ \pnum \tcode{E} shall satisfy the -\tcode{CopyConstructible} (\tref{copyconstructible}) -and \tcode{CopyAssignable} (\tref{copyassignable}) requirements. +\oldconcept{CopyConstructible} (\tref{copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. These operations shall each be of complexity no worse than \bigoh{\text{size of state}}. @@ -2580,8 +2580,8 @@ \pnum \tcode{D} shall satisfy the -\tcode{CopyConstructible} (\tref{copyconstructible}) -and \tcode{CopyAssignable} (\tref{copyassignable}) requirements. +\oldconcept{CopyConstructible} (\tref{copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. \pnum The sequence of numbers @@ -2612,10 +2612,10 @@ \pnum \tcode{P} shall satisfy the -\tcode{CopyConstructible} (\tref{copyconstructible}), -\tcode{CopyAssignable} (\tref{copyassignable}), +\oldconcept{CopyConstructible} (\tref{copyconstructible}), +\oldconcept{CopyAssignable} (\tref{copyassignable}), and -\tcode{EqualityComparable} (\tref{equalitycomparable}) requirements. +\oldconcept{Equality\-Comp\-arable} (\tref{equalitycomparable}) requirements. \pnum For each of the constructors of \tcode{D} @@ -4122,8 +4122,8 @@ \begin{itemdescr} \pnum\requires - \tcode{InputIterator} shall satisfy the requirements - of an input iterator (\tref{iterator.input.requirements}) type. + \tcode{InputIterator} shall satisfy the + \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} shall denote an integer type. @@ -4144,9 +4144,11 @@ \begin{itemdescr} \pnum\requires \tcode{RandomAccessIterator} - shall satisfy the requirements of a mutable random access iterator\iref{random.access.iterators}. + shall satisfy the + \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} + and the requirements of a mutable iterator. Moreover, - \tcode{iterator_traits::value_type} + \tcode{iterator_traits::\brk{}value_type} shall denote an unsigned integer type capable of accommodating 32-bit quantities. @@ -4249,8 +4251,8 @@ \begin{itemdescr} \pnum\requires - \tcode{OutputIterator} shall satisfy the requirements - of an output iterator\iref{output.iterators}. + \tcode{OutputIterator} shall satisfy the + \oldconcept{OutputIterator} requirements\iref{output.iterators}. Moreover, the expression \tcode{*dest = rt} @@ -5933,8 +5935,8 @@ \begin{itemdescr} \pnum \requires - \tcode{InputIterator} shall satisfy the requirements - of an input iterator\iref{input.iterators}. + \tcode{InputIterator} shall satisfy the + \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} shall denote a type that is convertible to \tcode{double}. @@ -6106,11 +6108,11 @@ \begin{itemdescr} \pnum\requires \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each satisfy the requirements - of an input iterator (\tref{iterator.input.requirements}) type. + shall each satisfy the + \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} and - \tcode{iterator_traits::value_type} + \tcode{iterator_traits::value_type} shall each denote a type that is convertible to \tcode{double}. If \tcode{firstB == lastB} or \tcode{++firstB == lastB}, @@ -6316,11 +6318,11 @@ \begin{itemdescr} \pnum\requires \tcode{InputIteratorB} and \tcode{InputIteratorW} - shall each satisfy the requirements - of an input iterator (\tref{iterator.input.requirements}) type. + shall each satisfy the + \oldconcept{InputIterator} requirements\iref{input.iterators}. Moreover, \tcode{iterator_traits::value_type} and - \tcode{iterator_traits::value_type} + \tcode{iterator_traits::value_type} shall each denote a type that is convertible to \tcode{double}. If \tcode{firstB == lastB} or \tcode{++firstB == lastB}, @@ -8906,8 +8908,8 @@ \begin{itemdescr} \pnum \requires -\tcode{T} shall satisfy the \tcode{CopyConstructible} (\tref{copyconstructible}) -and \tcode{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{T} shall satisfy the \oldconcept{CopyConstructible} (\tref{copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. In the range \crange{first}{last}, \tcode{binary_op} @@ -9013,7 +9015,7 @@ \pnum \requires \begin{itemize} -\item \tcode{T} shall be \tcode{MoveConstructible} (\tref{moveconstructible}). +\item \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). \item All of \tcode{binary_op(init, *first)}, \tcode{binary_op(*first, init)}, \tcode{binary_op(init, init)}, and \tcode{binary_op(*first, *first)} shall be convertible to \tcode{T}. @@ -9056,8 +9058,8 @@ \begin{itemdescr} \pnum \requires -\tcode{T} shall satisfy the \tcode{CopyConstructible} (\tref{copyconstructible}) -and \tcode{CopyAssignable} (\tref{copyassignable}) requirements. +\tcode{T} shall satisfy the \oldconcept{CopyConstructible} (\tref{copyconstructible}) +and \oldconcept{CopyAssignable} (\tref{copyassignable}) requirements. In the ranges \crange{first1}{last1} and @@ -9147,7 +9149,7 @@ \pnum \requires \begin{itemize} -\item \tcode{T} shall be \tcode{MoveConstructible} (\tref{moveconstructible}). +\item \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). \item All of \begin{itemize} \item \tcode{binary_op1(init, init)}, @@ -9191,7 +9193,7 @@ \pnum \requires \begin{itemize} -\item \tcode{T} shall be \tcode{MoveConstructible} (\tref{moveconstructible}). +\item \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). \item All of \begin{itemize} \item \tcode{binary_op(init, init)}, @@ -9328,7 +9330,7 @@ \pnum \requires \begin{itemize} -\item \tcode{T} shall be \tcode{MoveConstructible} (\tref{moveconstructible}). +\item \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). \item All of \tcode{binary_op(init, init)}, \tcode{binary_op(init, *first)}, and \tcode{binary_op(*first, *first)} shall be convertible to \tcode{T}. \item \tcode{binary_op} shall neither invalidate iterators or subranges, nor modify @@ -9423,9 +9425,9 @@ \pnum \requires \begin{itemize} -\item If \tcode{init} is provided, \tcode{T} shall be \tcode{MoveConstructible} +\item If \tcode{init} is provided, \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}); otherwise, \tcode{ForwardIterator1}'s value -type shall be \tcode{MoveConstructible}. +type shall be \oldconcept{MoveConstructible}. \item If \tcode{init} is provided, all of \tcode{binary_op(init, init)}, \tcode{binary_op(init, *first)}, and \tcode{binary_op(*first, *first)} shall be @@ -9493,7 +9495,7 @@ \pnum \requires \begin{itemize} -\item \tcode{T} shall be \tcode{MoveConstructible} (\tref{moveconstructible}). +\item \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}). \item All of \begin{itemize} \item \tcode{binary_op(init, init)}, @@ -9577,9 +9579,9 @@ \pnum \requires \begin{itemize} -\item If \tcode{init} is provided, \tcode{T} shall be \tcode{MoveConstructible} +\item If \tcode{init} is provided, \tcode{T} shall be \oldconcept{MoveConstructible} (\tref{moveconstructible}); otherwise, \tcode{ForwardIterator1}'s value -type shall be \tcode{MoveConstructible}. +type shall be \oldconcept{MoveConstructible}. \item If \tcode{init} is provided, all of \begin{itemize} @@ -9669,7 +9671,7 @@ \begin{itemize} \item For the overloads with no \tcode{ExecutionPolicy}, -\tcode{T} shall be \tcode{MoveAssignable} (\tref{moveassignable}) and shall +\tcode{T} shall be \oldconcept{MoveAssignable} (\tref{moveassignable}) and shall be constructible from the type of \tcode{*first}. \tcode{acc} (defined below) shall be writable\iref{iterator.requirements.general} to the \tcode{result} output iterator. The result of the expression diff --git a/source/regex.tex b/source/regex.tex index fdd175e675..f3c9c338a4 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -1695,8 +1695,9 @@ \begin{itemdescr} \pnum -\requires The type \tcode{InputIterator} shall satisfy the requirements for an Input -Iterator\iref{input.iterators}. +\requires +\tcode{InputIterator} shall satisfy the +\oldconcept{InputIterator} requirements\iref{input.iterators}. \pnum \returns \tcode{assign(string_type(first, last), f)}. @@ -2792,8 +2793,8 @@ \begin{itemdescr} \pnum -\requires \tcode{ready() == true} and \tcode{OutputIter} shall satisfy the requirements for an -Output Iterator\iref{output.iterators}. +\requires \tcode{ready() == true} and \tcode{OutputIter} shall satisfy the requirements for a +\oldconcept{OutputIterator}\iref{output.iterators}. \pnum \effects Copies the character sequence \range{fmt_first}{fmt_last} to @@ -2980,8 +2981,9 @@ \begin{itemdescr} \pnum -\requires The type \tcode{BidirectionalIterator} shall satisfy the requirements -of a bidirectional iterator\iref{bidirectional.iterators}. +\requires +The type \tcode{BidirectionalIterator} shall satisfy the +\oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \pnum \effects Determines whether there is a match between the @@ -3163,8 +3165,9 @@ \begin{itemdescr} \pnum -\requires Type \tcode{BidirectionalIterator} shall satisfy the requirements of a bidirectional -iterator\iref{bidirectional.iterators}. +\requires +Type \tcode{BidirectionalIterator} shall satisfy the +\oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators}. \pnum \effects Determines whether there is some sub-sequence within \range{first}{last} that matches diff --git a/source/strings.tex b/source/strings.tex index 0712aceda4..fa0b6a7fbb 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -276,9 +276,9 @@ \requires \tcode{state_type} shall satisfy the -\tcode{CopyAssignable} (\tref{copyassignable}), -\tcode{CopyConstructible} (\tref{copyconstructible}), and -\tcode{DefaultConstructible} (\tref{defaultconstructible}) requirements. +\oldconcept{CopyAssignable} (\tref{copyassignable}), +\oldconcept{CopyConstructible} (\tref{copyconstructible}), and +\oldconcept{DefaultConstructible} (\tref{defaultconstructible}) requirements. \end{itemdescr} \rSec2[char.traits.specializations]{\tcode{char_traits} specializations} diff --git a/source/support.tex b/source/support.tex index ac27414746..b727f39678 100644 --- a/source/support.tex +++ b/source/support.tex @@ -3652,7 +3652,7 @@ \pnum \tcode{exception_ptr} shall satisfy the requirements of -\tcode{NullablePointer} (\tref{nullablepointer}). +\oldconcept{NullablePointer} (\tref{nullablepointer}). \pnum Two non-null values of type \tcode{exception_ptr} are equivalent and compare equal if and @@ -3815,7 +3815,7 @@ Let \tcode{U} be \tcode{decay_t}. \pnum -\requires \tcode{U} shall be \tcode{CopyConstructible}. +\requires \tcode{U} shall be \oldconcept{CopyConstructible}. \pnum \throws diff --git a/source/threads.tex b/source/threads.tex index 50034e08f8..2d710a1eaa 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -133,7 +133,7 @@ \pnum Implementation-provided clocks that are used for these functions shall satisfy the -\tcode{TrivialClock} requirements\iref{time.clock.req}. +\oldconcept{TrivialClock} requirements\iref{time.clock.req}. \pnum A function that takes an argument which specifies a timeout will throw if, @@ -143,7 +143,7 @@ the implementation as specified in~\ref{time.clock} do not throw exceptions. \end{note} -\rSec2[thread.req.lockable]{Requirements for \tcode{Lockable} types} +\rSec2[thread.req.lockable]{Requirements for \oldconcept{Lockable} types} \rSec3[thread.req.lockable.general]{In general} @@ -165,16 +165,16 @@ \tcode{lock_guard}\iref{thread.lock.guard}, \tcode{lock}, \tcode{try_lock}\iref{thread.lock.algorithm}, and \tcode{condition_variable_any}\iref{thread.condition.condvarany} all operate on user-supplied -lockable objects. The \tcode{BasicLockable} requirements, the \tcode{Lockable} requirements, -and the \tcode{TimedLockable} requirements list the requirements imposed by these library types +lockable objects. The \oldconcept{BasicLockable} requirements, the \oldconcept{Lockable} requirements, +and the \oldconcept{TimedLockable} requirements list the requirements imposed by these library types in order to acquire or release ownership of a \tcode{lock} by a given execution agent. \begin{note} The nature of any lock ownership and any synchronization it may entail are not part of these requirements. \end{note} -\rSec3[thread.req.lockable.basic]{\tcode{BasicLockable} requirements} +\rSec3[thread.req.lockable.basic]{\oldconcept{BasicLockable} requirements} \pnum -A type \tcode{L} meets the \tcode{BasicLockable} requirements if the following expressions are +A type \tcode{L} meets the \oldconcept{BasicLockable} requirements if the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}). \begin{itemdecl} @@ -202,10 +202,10 @@ \throws Nothing. \end{itemdescr} -\rSec3[thread.req.lockable.req]{\tcode{Lockable} requirements} +\rSec3[thread.req.lockable.req]{\oldconcept{Lockable} requirements} \pnum -A type \tcode{L} meets the \tcode{Lockable} requirements if it meets the \tcode{BasicLockable} +A type \tcode{L} meets the \oldconcept{Lockable} requirements if it meets the \oldconcept{BasicLockable} requirements and the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}). @@ -225,10 +225,10 @@ \returns \tcode{true} if the lock was acquired, \tcode{false} otherwise. \end{itemdescr} -\rSec3[thread.req.lockable.timed]{\tcode{TimedLockable} requirements} +\rSec3[thread.req.lockable.timed]{\oldconcept{TimedLockable} requirements} \pnum -A type \tcode{L} meets the \tcode{TimedLockable} requirements if it meets the \tcode{Lockable} +A type \tcode{L} meets the \oldconcept{TimedLockable} requirements if it meets the \oldconcept{Lockable} requirements and the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}, \tcode{rel_time} denotes a value of an instantiation of \tcode{duration}\iref{time.duration}, and \tcode{abs_time} denotes a value @@ -522,7 +522,7 @@ \begin{itemdescr} \pnum \requires\ \tcode{F} and each $\tcode{T}_i$ in \tcode{Args} shall satisfy the -\tcode{MoveConstructible} requirements. +\oldconcept{MoveConstructible} requirements. \tcode{% \placeholdernc{INVOKE}(\brk{}% \placeholdernc{DECAY_COPY}(\brk{}% @@ -895,10 +895,10 @@ denotes an object of a mutex type. \pnum -The mutex types shall satisfy the \tcode{Lockable} requirements\iref{thread.req.lockable.req}. +The mutex types shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \pnum -The mutex types shall be \tcode{DefaultConstructible} and \tcode{Destructible}. If +The mutex types shall be \oldconcept{DefaultConstructible} and \oldconcept{Destructible}. If initialization of an object of a mutex type fails, an exception of type \tcode{system_error} shall be thrown. The mutex types shall not be copyable or movable. @@ -1141,7 +1141,7 @@ instantiation of \tcode{time_point}\iref{time.point}. \pnum -The timed mutex types shall satisfy the \tcode{TimedLockable} +The timed mutex types shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum @@ -1681,7 +1681,7 @@ object throughout the \tcode{lock_guard} object's lifetime\iref{basic.life}. The behavior of a program is undefined if the lockable object referenced by \tcode{pm} does not exist for the entire lifetime of the \tcode{lock_guard} -object. The supplied \tcode{Mutex} type shall satisfy the \tcode{BasicLockable} +object. The supplied \tcode{Mutex} type shall satisfy the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \indexlibrary{\idxcode{lock_guard}!constructor}% @@ -1760,9 +1760,9 @@ object. When \tcode{sizeof...(MutexTypes)} is \tcode{1}, the supplied \tcode{Mutex} type -shall satisfy the \tcode{BasicLockable} requirements\iref{thread.req.lockable.basic}. +shall satisfy the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. Otherwise, each of the mutex types -shall satisfy the \tcode{Lockable} requirements\iref{thread.req.lockable.req}. +shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \indexlibrary{\idxcode{scoped_lock}!constructor}% \begin{itemdecl} @@ -1875,16 +1875,16 @@ \tcode{pm} is not null and the lockable object pointed to by \tcode{pm} does not exist for the entire remaining lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied -\tcode{Mutex} type shall satisfy the \tcode{BasicLockable} +\tcode{Mutex} type shall satisfy the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \pnum -\begin{note} \tcode{unique_lock} meets the \tcode{BasicLockable} requirements. If \tcode{Mutex} -meets the \tcode{Lockable} requirements\iref{thread.req.lockable.req}, -\tcode{unique_lock} also meets the \tcode{Lockable} requirements; +\begin{note} \tcode{unique_lock} meets the \oldconcept{BasicLockable} requirements. If \tcode{Mutex} +meets the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}, +\tcode{unique_lock} also meets the \oldconcept{Lockable} requirements; if \tcode{Mutex} -meets the \tcode{TimedLockable} requirements\iref{thread.req.lockable.timed}, -\tcode{unique_lock} also meets the \tcode{TimedLockable} requirements. \end{note} +meets the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}, +\tcode{unique_lock} also meets the \oldconcept{TimedLockable} requirements. \end{note} \rSec4[thread.lock.unique.cons]{\tcode{unique_lock} constructors, destructor, and assignment} @@ -1938,7 +1938,7 @@ \begin{itemdescr} \pnum \requires -The supplied \tcode{Mutex} type shall satisfy the \tcode{Lockable} +The supplied \tcode{Mutex} type shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. If \tcode{mutex_type} is not a recursive mutex the calling thread does not own the mutex. @@ -1979,7 +1979,7 @@ \pnum \requires If \tcode{mutex_type} is not a recursive mutex the calling thread does not own the mutex. The supplied \tcode{Mutex} type shall satisfy the -\tcode{TimedLockable} requirements\iref{thread.req.lockable.timed}. +\oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum \effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock_until(abs_time)}. @@ -1999,7 +1999,7 @@ \begin{itemdescr} \pnum \requires If \tcode{mutex_type} is not a recursive mutex the calling thread does not own the mutex. -The supplied \tcode{Mutex} type shall satisfy the \tcode{TimedLockable} requirements\iref{thread.req.lockable.timed}. +The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum \effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock_for(rel_time)}. @@ -2079,7 +2079,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} shall satisfy the \tcode{Lockable} +\requires The supplied \tcode{Mutex} shall satisfy the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. \pnum @@ -2113,7 +2113,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} type shall satisfy the \tcode{TimedLockable} +\requires The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum @@ -2147,7 +2147,7 @@ \begin{itemdescr} \pnum -\requires The supplied \tcode{Mutex} type shall satisfy the \tcode{TimedLockable} requirements\iref{thread.req.lockable.timed}. +\requires The supplied \tcode{Mutex} type shall satisfy the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \pnum \effects As if by \tcode{pm->try_lock_for(rel_time)}. @@ -2320,7 +2320,7 @@ requirements\iref{thread.sharedtimedmutex.requirements}. \pnum -\begin{note} \tcode{shared_lock} meets the \tcode{TimedLockable} +\begin{note} \tcode{shared_lock} meets the \oldconcept{TimedLockable} requirements\iref{thread.req.lockable.timed}. \end{note} \rSec4[thread.lock.shared.cons]{\tcode{shared_lock} constructors, destructor, and assignment} @@ -2695,7 +2695,7 @@ \begin{itemdescr} \pnum -\requires Each template parameter type shall satisfy the \tcode{Lockable} requirements. \begin{note} The +\requires Each template parameter type shall satisfy the \oldconcept{Lockable} requirements. \begin{note} The \tcode{unique_lock} class template meets these requirements when suitably instantiated. \end{note} @@ -2719,7 +2719,7 @@ \begin{itemdescr} \pnum -\requires Each template parameter type shall satisfy the \tcode{Lockable} requirements, +\requires Each template parameter type shall satisfy the \oldconcept{Lockable} requirements, \begin{note} The \tcode{unique_lock} class template meets these requirements when suitably instantiated. \end{note} @@ -3325,7 +3325,7 @@ \rSec2[thread.condition.condvarany]{Class \tcode{condition_variable_any}} \pnum -A \tcode{Lock} type shall satisfy the \tcode{BasicLockable} +A \tcode{Lock} type shall satisfy the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. \begin{note} All of the standard mutex types meet this requirement. If a \tcode{Lock} type other than one of the standard mutex types or a \tcode{unique_lock} wrapper for a standard mutex type @@ -3934,7 +3934,7 @@ \begin{itemdescr} \pnum -\requires \tcode{Alloc} shall satisfy the \tcode{Allocator} +\requires \tcode{Alloc} shall satisfy the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \end{itemdescr} @@ -4787,7 +4787,7 @@ \pnum \requires \tcode{F} and each $\tcode{T}_i$ in \tcode{Args} shall satisfy the -\tcode{MoveConstructible} requirements, and +\oldconcept{MoveConstructible} requirements, and \begin{codeblock} @\placeholdernc{INVOKE}@(@\placeholdernc{DECAY_COPY}@(std::forward(f)), @\placeholdernc{DECAY_COPY}@(std::forward(args))...) // see \ref{func.require}, \ref{thread.thread.constr} diff --git a/source/utilities.tex b/source/utilities.tex index e020f661dd..e95e527617 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -204,9 +204,9 @@ Type \tcode{T} shall be -\tcode{MoveConstructible} (\tref{moveconstructible}) +\oldconcept{MoveConstructible} (\tref{moveconstructible}) and -\tcode{MoveAssignable} (\tref{moveassignable}). +\oldconcept{MoveAssignable} (\tref{moveassignable}). \pnum \effects @@ -1411,7 +1411,7 @@ \begin{itemdescr} \pnum \requires \tcode{Alloc} shall satisfy the -\tcode{Allocator} requirements (\tref{utilities.allocator.requirements}). +\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \pnum \effects Equivalent to the preceding constructors except that each element is constructed with @@ -1780,7 +1780,7 @@ \begin{itemdescr} \pnum \remarks All specializations of \tcode{tuple_size} shall satisfy the -\tcode{UnaryTypeTrait} requirements\iref{meta.rqmts} with a +\oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant} for some \tcode{N}. \end{itemdescr} @@ -1823,7 +1823,7 @@ Let \tcode{TS} denote \tcode{tuple_size} of the \cv-unqualified type \tcode{T}. If the expression \tcode{TS::value} is well-formed when treated as an unevaluated operand, then each -of the three templates shall satisfy the \tcode{UnaryTypeTrait} requirements\iref{meta.rqmts} +of the three templates shall satisfy the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \begin{codeblock} integral_constant @@ -1858,7 +1858,7 @@ \begin{itemdescr} \pnum Let \tcode{TE} denote \tcode{tuple_element_t} of the \cv-unqualified type \tcode{T}. Then -each of the three templates shall satisfy the \tcode{TransformationTrait} +each of the three templates shall satisfy the \oldconcept{TransformationTrait} requirements\iref{meta.rqmts} with a member typedef \tcode{type} that names the following type: @@ -2073,7 +2073,7 @@ \begin{itemdescr} \pnum -\requires \tcode{Alloc} shall satisfy the \tcode{Allocator} +\requires \tcode{Alloc} shall satisfy the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \pnum @@ -2285,7 +2285,7 @@ Member \tcode{val} is provided for exposition only. When an \tcode{optional} object contains a value, \tcode{val} points to the contained value. \pnum -\tcode{T} shall be an object type and shall satisfy the \tcode{Destructible} requirements (\tref{destructible}). +\tcode{T} shall be an object type and shall satisfy the \oldconcept{Destructible} requirements (\tref{destructible}). \rSec3[optional.ctor]{Constructors} @@ -3162,7 +3162,7 @@ \requires The expression \tcode{*x == *y} shall be well-formed and its result shall be convertible to \tcode{bool}. -\begin{note} \tcode{T} need not be \tcode{EqualityComparable}. \end{note} +\begin{note} \tcode{T} need not be \oldconcept{EqualityComparable}. \end{note} \pnum \returns @@ -3422,7 +3422,7 @@ The expression \tcode{*x == v} shall be well-formed and its result shall be convertible to \tcode{bool}. \begin{note} -\tcode{T} need not be \tcode{EqualityComparable}. +\tcode{T} need not be \oldconcept{EqualityComparable}. \end{note} \pnum @@ -4545,7 +4545,7 @@ \pnum \remarks All specializations of \tcode{variant_size} shall satisfy the -\tcode{UnaryTypeTrait} requirements\iref{meta.rqmts} +\oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant} for some \tcode{N}. \end{itemdescr} @@ -4560,7 +4560,7 @@ \pnum Let \tcode{VS} denote \tcode{variant_size} of the cv-unqualified type \tcode{T}. Then each of the three templates shall satisfy the -\tcode{UnaryTypeTrait} requirements\iref{meta.rqmts} with a +\oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant}. \end{itemdescr} @@ -4582,7 +4582,7 @@ \pnum Let \tcode{VA} denote \tcode{variant_alternative} of the cv-unqualified type \tcode{T}. Then each of the three templates shall -meet the \tcode{TransformationTrait} requirements\iref{meta.rqmts} with a +meet the \oldconcept{TransformationTrait} requirements\iref{meta.rqmts} with a member typedef \tcode{type} that names the following type: \begin{itemize} \item for the first specialization, \tcode{add_const_t}, @@ -5196,7 +5196,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects @@ -5225,7 +5225,7 @@ Let \tcode{VT} be \tcode{decay_t}. \pnum -\requires \tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\requires \tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects Initializes the contained value as if direct-non-list-initializing an object of @@ -5255,7 +5255,7 @@ Let \tcode{VT} be \tcode{decay_t}. \pnum -\requires \tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\requires \tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects Initializes the contained value as if direct-non-list-initializing an object of @@ -5339,7 +5339,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects @@ -5375,7 +5375,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects Calls \tcode{reset()}. @@ -5413,7 +5413,7 @@ \pnum \requires -\tcode{VT} shall satisfy the \tcode{CopyConstructible} requirements. +\tcode{VT} shall satisfy the \oldconcept{CopyConstructible} requirements. \pnum \effects Calls \tcode{reset()}. Then initializes the contained value @@ -7131,7 +7131,7 @@ disambiguate constructor and function overloading. Specifically, several types (see \tcode{tuple}~\ref{tuple}) have constructors with \tcode{allocator_arg_t} as the first argument, immediately followed by an argument of a type that satisfies the -\tcode{Allocator} requirements (\tref{utilities.allocator.requirements}). +\oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \rSec2[allocator.uses]{\tcode{uses_allocator}} @@ -7145,7 +7145,7 @@ \begin{itemdescr} \pnum \remarks Automatically detects whether \tcode{T} has a nested \tcode{allocator_type} that -is convertible from \tcode{Alloc}. Meets the \tcode{BinaryTypeTrait} +is convertible from \tcode{Alloc}. Meets the \oldconcept{BinaryTypeTrait} requirements\iref{meta.rqmts}. The implementation shall provide a definition that is derived from \tcode{true_type} if the \grammarterm{qualified-id} \tcode{T::allocator_type} is valid and denotes a type\iref{temp.deduct} and @@ -7594,12 +7594,12 @@ \begin{itemize} \item If an algorithm's template parameter is named \tcode{InputIterator}, -the template argument shall satisfy the requirements -of an input iterator\iref{input.iterators}. +the template argument shall satisfy the +\oldconcept{InputIterator} requirements\iref{input.iterators}. \item If an algorithm's template parameter is named \tcode{ForwardIterator}, -the template argument shall satisfy the requirements -of a forward iterator\iref{forward.iterators}, and +the template argument shall satisfy the +\oldconcept{ForwardIterator} requirements\iref{forward.iterators}, and is required to have the property that no exceptions are thrown from increment, assignment, comparison, or indirection through valid iterators. \end{itemize} @@ -7975,8 +7975,8 @@ Each object of a type \tcode{U} instantiated from the \tcode{unique_ptr} template specified in this subclause has the strict ownership semantics, specified above, of a unique pointer. In partial satisfaction of these semantics, each such \tcode{U} -is \tcode{MoveConstructible} and \tcode{MoveAssignable}, but is not -\tcode{CopyConstructible} nor \tcode{CopyAssignable}. +is \oldconcept{MoveConstructible} and \oldconcept{MoveAssignable}, but is not +\oldconcept{CopyConstructible} nor \oldconcept{CopyAssignable}. The template parameter \tcode{T} of \tcode{unique_ptr} may be an incomplete type. \pnum @@ -8146,7 +8146,7 @@ \pnum If the deleter's type \tcode{D} is not a reference type, \tcode{D} shall satisfy -the \tcode{Destructible} requirements (\tref{destructible}). +the \oldconcept{Destructible} requirements (\tref{destructible}). \pnum If the \grammarterm{qualified-id} \tcode{remove_reference_t::pointer} is valid and denotes a @@ -8154,7 +8154,7 @@ D>::pointer} shall be a synonym for \tcode{remove_reference_t::pointer}. Otherwise \tcode{unique_ptr::pointer} shall be a synonym for \tcode{element_type*}. The type \tcode{unique_ptr::pointer} shall -satisfy the \tcode{NullablePointer} requirements (\tref{nullablepointer}). +satisfy the \oldconcept{NullablePointer} requirements (\tref{nullablepointer}). \pnum \begin{example} Given an allocator type \tcode{X} (\tref{utilities.allocator.requirements}) and @@ -8173,7 +8173,7 @@ \begin{itemdescr} \pnum \requires \tcode{D} shall -satisfy the \tcode{DefaultConstructible} requirements (\tref{defaultconstructible}), +satisfy the \oldconcept{DefaultConstructible} requirements (\tref{defaultconstructible}), and that construction shall not throw an exception. \pnum @@ -8198,7 +8198,7 @@ \begin{itemdescr} \pnum \requires \tcode{D} shall -satisfy the \tcode{DefaultConstructible} requirements (\tref{defaultconstructible}), +satisfy the \oldconcept{DefaultConstructible} requirements (\tref{defaultconstructible}), and that construction shall not throw an exception. \pnum @@ -8256,10 +8256,10 @@ \pnum \requires For the first constructor, if \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \tcode{CopyConstructible} requirements and +\tcode{D} shall satisfy the \oldconcept{CopyConstructible} requirements and such construction shall not exit via an exception. For the second constructor, if \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \tcode{MoveConstructible} requirements and +\tcode{D} shall satisfy the \oldconcept{MoveConstructible} requirements and such construction shall not exit via an exception. \pnum @@ -8286,8 +8286,8 @@ \begin{example} \begin{codeblock} D d; -unique_ptr p1(new int, D()); // \tcode{D} must be \tcode{MoveConstructible} -unique_ptr p2(new int, d); // \tcode{D} must be \tcode{CopyConstructible} +unique_ptr p1(new int, D()); // \tcode{D} must be \oldconcept{MoveConstructible} +unique_ptr p2(new int, d); // \tcode{D} must be \oldconcept{CopyConstructible} unique_ptr p3(new int, d); // \tcode{p3} holds a reference to \tcode{d} unique_ptr p4(new int, D()); // error: rvalue deleter object combined // with reference deleter type @@ -8303,7 +8303,7 @@ \begin{itemdescr} \pnum \requires If \tcode{D} is not a reference type, -\tcode{D} shall satisfy the \tcode{MoveConstructible} +\tcode{D} shall satisfy the \oldconcept{MoveConstructible} requirements (\tref{moveconstructible}). Construction of the deleter from an rvalue of type \tcode{D} shall not @@ -8393,10 +8393,10 @@ \begin{itemdescr} \pnum \requires If \tcode{D} is not a reference type, \tcode{D} shall satisfy the -\tcode{MoveAssignable} requirements (\tref{moveassignable}) and assignment +\oldconcept{MoveAssignable} requirements (\tref{moveassignable}) and assignment of the deleter from an rvalue of type \tcode{D} shall not throw an exception. Otherwise, \tcode{D} is a reference type; -\tcode{remove_reference_t} shall satisfy the \tcode{CopyAssignable} +\tcode{remove_reference_t} shall satisfy the \oldconcept{CopyAssignable} requirements and assignment of the deleter from an lvalue of type \tcode{D} shall not throw an exception. @@ -9177,8 +9177,8 @@ \end{codeblock} \pnum -Specializations of \tcode{shared_ptr} shall be \tcode{CopyConstructible}, -\tcode{CopyAssignable}, and \tcode{LessThanComparable}, allowing their use in standard +Specializations of \tcode{shared_ptr} shall be \oldconcept{CopyConstructible}, +\oldconcept{CopyAssignable}, and \oldconcept{\-Less\-Than\-Comparable}, allowing their use in standard containers. Specializations of \tcode{shared_ptr} shall be contextually convertible to \tcode{bool}, allowing their use in boolean expressions and declarations in conditions. The template @@ -9287,7 +9287,7 @@ initialized with \tcode{std::move(d)} shall not throw exceptions. The expression \tcode{d(p)} shall have well-defined behavior and shall not throw exceptions. -\tcode{A} shall satisfy the \tcode{Allocator} requirements +\tcode{A} shall satisfy the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \pnum\effects Constructs a \tcode{shared_ptr} object that owns the @@ -9688,7 +9688,7 @@ \begin{itemdescr} \pnum -\requires \tcode{A} shall satisfy the \tcode{Allocator} +\requires \tcode{A} shall satisfy the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). \pnum @@ -10279,8 +10279,8 @@ \end{codeblock} \pnum -Specializations of \tcode{weak_ptr} shall be \tcode{CopyConstructible} and -\tcode{CopyAssignable}, allowing their use in standard +Specializations of \tcode{weak_ptr} shall be \oldconcept{CopyConstructible} and +\oldconcept{CopyAssignable}, allowing their use in standard containers. The template parameter \tcode{T} of \tcode{weak_ptr} may be an incomplete type. @@ -11344,7 +11344,7 @@ \pnum A specialization of class template \tcode{pmr::polymorphic_allocator} -satisfies the \tcode{Allocator} requirements (\tref{utilities.allocator.requirements}). +satisfies the \oldconcept{Allocator} requirements (\tref{utilities.allocator.requirements}). Constructed with different memory resources, different instances of the same specialization of \tcode{pmr::polymorphic_allocator} can exhibit entirely different allocation behavior. @@ -13201,14 +13201,14 @@ \indextext{call wrapper!simple}% \indextext{call wrapper!forwarding}% Every call wrapper\iref{func.def} shall be -\tcode{MoveConstructible}. +\oldconcept{MoveConstructible}. A \defn{forwarding call wrapper} is a call wrapper that can be called with an arbitrary argument list and delivers the arguments to the wrapped callable object as references. This forwarding step shall ensure that rvalue arguments are delivered as rvalue references and lvalue arguments are delivered as lvalue references. A \defn{simple call wrapper} is a forwarding call wrapper that is -\tcode{CopyConstructible} and \tcode{CopyAssignable} and +\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} and whose copy constructor, move constructor, copy assignment operator, and move assignment operator do not throw exceptions. \begin{note} @@ -13270,7 +13270,7 @@ \end{codeblock} \pnum -\tcode{reference_wrapper} is a \tcode{CopyConstructible} and \tcode{CopyAssignable} wrapper +\tcode{reference_wrapper} is a \oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} wrapper around a reference to an object or function of type \tcode{T}. \pnum @@ -14214,7 +14214,7 @@ \begin{itemdescr} \pnum \requires -\tcode{FD} shall satisfy the \tcode{MoveConstructible} requirements. +\tcode{FD} shall satisfy the \oldconcept{MoveConstructible} requirements. \tcode{is_constructible_v} shall be \tcode{true}. \tcode{fd} shall be a callable object\iref{func.def}. @@ -14286,7 +14286,7 @@ \pnum Instantiations of the \tcode{is_bind_expression} template shall satisfy -the \tcode{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation +the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation shall provide a definition that has a base characteristic of \tcode{true_type} if \tcode{T} is a type returned from \tcode{bind}, otherwise it shall have a base characteristic of \tcode{false_type}. @@ -14310,7 +14310,7 @@ \pnum Instantiations of the \tcode{is_placeholder} template shall satisfy -the \tcode{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation +the \oldconcept{UnaryTypeTrait} requirements\iref{meta.rqmts}. The implementation shall provide a definition that has the base characteristic of \tcode{integral_constant} if \tcode{T} is the type of \tcode{std::placeholders::_\placeholder{J}}, otherwise it shall have a @@ -14374,10 +14374,10 @@ \tcode{fd} or of one of the values $\tcode{td}_i$ throws an exception. \pnum -\remarks The return type shall satisfy the \tcode{MoveConstructible} requirements. If all -of \tcode{FD} and $\tcode{TD}_i$ satisfy the \tcode{CopyConstructible} requirements, then the -return type shall satisfy the \tcode{CopyConstructible} requirements. \begin{note} This implies -that all of \tcode{FD} and $\tcode{TD}_i$ are \tcode{MoveConstructible}. \end{note} +\remarks The return type shall satisfy the \oldconcept{MoveConstructible} requirements. If all +of \tcode{FD} and $\tcode{TD}_i$ satisfy the \oldconcept{CopyConstructible} requirements, then the +return type shall satisfy the \oldconcept{CopyConstructible} requirements. \begin{note} This implies +that all of \tcode{FD} and $\tcode{TD}_i$ are \oldconcept{MoveConst\-ruct\-ible}. \end{note} \end{itemdescr} \indexlibrary{\idxcode{bind}}% @@ -14417,10 +14417,10 @@ \tcode{fd} or of one of the values $\tcode{td}_i$ throws an exception. \pnum -\remarks The return type shall satisfy the \tcode{MoveConstructible} requirements. If all -of \tcode{FD} and $\tcode{TD}_i$ satisfy the \tcode{CopyConstructible} requirements, then the -return type shall satisfy the \tcode{CopyConstructible} requirements. \begin{note} This implies -that all of \tcode{FD} and $\tcode{TD}_i$ are \tcode{MoveConstructible}. \end{note} +\remarks The return type shall satisfy the \oldconcept{MoveConstructible} requirements. If all +of \tcode{FD} and $\tcode{TD}_i$ satisfy the \oldconcept{CopyConstructible} requirements, then the +return type shall satisfy the \oldconcept{CopyConstructible} requirements. \begin{note} This implies +that all of \tcode{FD} and $\tcode{TD}_i$ are \oldconcept{MoveConst\-ruct\-ible}. \end{note} \end{itemdescr} \pnum @@ -14467,11 +14467,11 @@ \end{codeblock} \pnum -All placeholder types shall be \tcode{DefaultConstructible} and -\tcode{CopyConstructible}, and their default constructors and copy/move +All placeholder types shall be \oldconcept{DefaultConstructible} and +\oldconcept{CopyConstructible}, and their default constructors and copy/move constructors shall not throw exceptions. It is \impldef{assignability of placeholder objects} whether -placeholder types are \tcode{CopyAssignable}. \tcode{CopyAssignable} placeholders' copy +placeholder types are \oldconcept{CopyAssignable}. \oldconcept{CopyAssignable} placeholders' copy assignment operators shall not throw exceptions. \pnum @@ -14710,7 +14710,7 @@ \begin{itemdescr} \pnum -\requires \tcode{F} shall be \tcode{CopyConstructible}. +\requires \tcode{F} shall be \oldconcept{CopyConstructible}. \pnum \remarks This constructor template shall not participate in overload resolution unless @@ -14956,7 +14956,8 @@ provided to the function call operator. \pnum -Each specialization of a class template specified in this subclause \ref{func.search} shall satisfy the \tcode{CopyConstructible} and \tcode{CopyAssignable} requirements. +Each specialization of a class template specified in this subclause \ref{func.search} +shall satisfy the \oldconcept{CopyConst\-ruct\-ible} and \oldconcept{CopyAssignable} requirements. Template parameters named \begin{itemize} \item \tcode{ForwardIterator}, @@ -14970,7 +14971,7 @@ of templates specified in this subclause \ref{func.search} shall satisfy the same requirements and semantics as specified in \ref{algorithms.general}. -Template parameters named \tcode{Hash} shall satisfy the \tcode{Hash} +Template parameters named \tcode{Hash} shall satisfy the \oldconcept{Hash} requirements (\tref{hash}). \pnum @@ -15074,8 +15075,8 @@ \begin{itemdescr} \pnum \requires -The value type of \tcode{RandomAccessIterator1} shall satisfy the \tcode{DefaultConstructible} requirements, -the \tcode{CopyConstructible} requirements, and the \tcode{CopyAssignable} requirements. +The value type of \tcode{RandomAccessIterator1} shall satisfy the \oldconcept{DefaultConstructible} requirements, +the \oldconcept{CopyConstructible} requirements, and the \oldconcept{CopyAssignable} requirements. \pnum \requires @@ -15167,8 +15168,8 @@ \begin{itemdescr} \pnum \requires -The value type of \tcode{RandomAccessIterator1} shall satisfy the \tcode{DefaultConstructible}, -\tcode{Copy\-Constructible}, and \tcode{CopyAssignable} requirements. +The value type of \tcode{RandomAccessIterator1} shall satisfy the \oldconcept{DefaultConstructible}, +\oldconcept{Copy\-Constructible}, and \oldconcept{CopyAssignable} requirements. \pnum \requires @@ -15236,7 +15237,7 @@ Each specialization of \tcode{hash} is either enabled or disabled, as described below. \begin{note} -Enabled specializations meet the \tcode{Hash} requirements, and +Enabled specializations meet the \oldconcept{Hash} requirements, and disabled specializations do not. \end{note} Each header that declares the template \tcode{hash} @@ -15263,16 +15264,16 @@ are not function object types\iref{function.objects}. \begin{note} This means that the specialization of \tcode{hash} exists, but -any attempts to use it as a \tcode{Hash} will be ill-formed. +any attempts to use it as a \oldconcept{Hash} will be ill-formed. \end{note} \pnum An enabled specialization \tcode{hash} will: \begin{itemize} -\item satisfy the \tcode{Hash} requirements (\tref{hash}), +\item satisfy the \oldconcept{Hash} requirements (\tref{hash}), with \tcode{Key} as the function -call argument type, the \tcode{Default\-Constructible} requirements (\tref{defaultconstructible}), -the \tcode{CopyAssignable} requirements (\tref{copyassignable}), +call argument type, the \oldconcept{Default\-Constructible} requirements (\tref{defaultconstructible}), +the \oldconcept{CopyAssignable} requirements (\tref{copyassignable}), \item be swappable\iref{swappable.requirements} for lvalues, \item satisfy the requirement that if \tcode{k1 == k2} is \tcode{true}, \tcode{h(k1) == h(k2)} is also \tcode{true}, where \tcode{h} is an object of type \tcode{hash} and \tcode{k1} and \tcode{k2} @@ -15304,11 +15305,11 @@ \rSec2[meta.rqmts]{Requirements} \pnum -A \defn{UnaryTypeTrait} describes a property +A \defn{Cpp98UnaryTypeTrait} describes a property of a type. It shall be a class template that takes one template type argument and, optionally, additional arguments that help define the -property being described. It shall be \tcode{DefaultConstructible}, -\tcode{CopyConstructible}, +property being described. It shall be \oldconcept{DefaultConstructible}, +\oldconcept{CopyConstructible}, and publicly and unambiguously derived, directly or indirectly, from its \defn{base characteristic}, which is a specialization of the template @@ -15316,14 +15317,14 @@ the arguments to the template \tcode{integral_constant} determined by the requirements for the particular property being described. The member names of the base characteristic shall not be hidden and shall be -unambiguously available in the \tcode{UnaryTypeTrait}. +unambiguously available in the \oldconcept{UnaryTypeTrait}. \pnum -A \defn{BinaryTypeTrait} describes a +A \defn{Cpp98BinaryTypeTrait} describes a relationship between two types. It shall be a class template that takes two template type arguments and, optionally, additional arguments that help define the relationship being described. It shall -be \tcode{DefaultConstructible}, \tcode{CopyConstructible}, +be \oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, and publicly and unambiguously derived, directly or indirectly, from its \term{base characteristic}, which is a specialization @@ -15332,10 +15333,10 @@ the arguments to the template \tcode{integral_constant} determined by the requirements for the particular relationship being described. The member names of the base characteristic shall not be hidden and shall be -unambiguously available in the \tcode{BinaryTypeTrait}. +unambiguously available in the \oldconcept{BinaryTypeTrait}. \pnum -A \defn{TransformationTrait} +A \defn{Cpp98TransformationTrait} modifies a property of a type. It shall be a class template that takes one template type argument and, optionally, additional arguments that help @@ -15789,7 +15790,7 @@ \pnum Each of these templates shall be a -\tcode{UnaryTypeTrait}\iref{meta.rqmts} +\oldconcept{UnaryTypeTrait}\iref{meta.rqmts} with a base characteristic of \tcode{true_type} if the corresponding condition is \tcode{true}, otherwise \tcode{false_type}. @@ -16454,7 +16455,7 @@ \end{libreqtab2a} \pnum -Each of these templates shall be a \tcode{UnaryTypeTrait}\iref{meta.rqmts} with a +Each of these templates shall be a \oldconcept{UnaryTypeTrait}\iref{meta.rqmts} with a base characteristic of \tcode{integral_constant}. \pnum @@ -16490,7 +16491,7 @@ \pnum Each of these templates shall be a -\tcode{BinaryTypeTrait}\iref{meta.rqmts} +\oldconcept{BinaryTypeTrait}\iref{meta.rqmts} with a base characteristic of \tcode{true_type} if the corresponding condition is true, otherwise \tcode{false_type}. @@ -16637,7 +16638,7 @@ \pnum Each of the templates in this subclause shall be a -\tcode{TransformationTrait}\iref{meta.rqmts}. +\oldconcept{TransformationTrait}\iref{meta.rqmts}. \rSec3[meta.trans.cv]{Const-volatile modifications} @@ -17211,7 +17212,7 @@ The class template \tcode{negation} forms the logical negation of its template type argument. The type \tcode{negation} -is a \tcode{UnaryTypeTrait} with a base characteristic of \tcode{bool_constant}. +is a \oldconcept{UnaryTypeTrait} with a base characteristic of \tcode{bool_constant}. \end{itemdescr} \rSec2[meta.endian]{Endian} @@ -18489,7 +18490,7 @@ } \end{codeblock} -\rSec2[time.clock.req]{Clock requirements} +\rSec2[time.clock.req]{\oldconcept{Clock} requirements} \pnum A clock is a bundle consisting of a \tcode{duration}, a @@ -18507,7 +18508,7 @@ \tcode{t2}. \end{note} \begin{libreqtab3a} -{Clock requirements} +{\oldconcept{Clock} requirements} {tab:time.clock} \\ \topline \lhdr{Expression} & \chdr{Return type} & \rhdr{Operational semantics} \\ \capsep @@ -18550,18 +18551,18 @@ SI definition is a measure of the quality of implementation. \end{note} \pnum -A type \tcode{TC} meets the \tcode{TrivialClock} requirements if: +A type \tcode{TC} meets the \oldconcept{TrivialClock} requirements if: \begin{itemize} -\item \tcode{TC} satisfies the \tcode{Clock} requirements\iref{time.clock.req}, +\item \tcode{TC} satisfies the \oldconcept{Clock} requirements\iref{time.clock.req}, \item the types \tcode{TC::rep}, \tcode{TC::duration}, and \tcode{TC::time_point} -satisfy the \tcode{EqualityComparable} (\tref{equalitycomparable}), -\tcode{LessThanComparable} (\tref{lessthancomparable}), -\tcode{DefaultConstructible} (\tref{defaultconstructible}), -\tcode{CopyCon\-structible} (\tref{copyconstructible}), -\tcode{CopyAssignable} (\tref{copyassignable}), and -\tcode{Destructible} (\tref{destructible}) requirements and the requirements of +satisfy the \oldconcept{EqualityComparable} (\tref{equalitycomparable}), +\oldconcept{LessThanComparable} (\tref{lessthancomparable}), +\oldconcept{DefaultConstructible} (\tref{defaultconstructible}), +\oldconcept{\-Copy\-Con\-structible} (\tref{copyconstructible}), +\oldconcept{CopyAssignable} (\tref{copyassignable}), and +\oldconcept{Destructible} (\tref{destructible}) requirements and the requirements of numeric types\iref{numeric.requirements}. \begin{note} This means, in particular, that operations on these types will not throw exceptions. \end{note} @@ -18570,7 +18571,7 @@ \item the function \tcode{TC::now()} does not throw exceptions, and -\item the type \tcode{TC::time_point::clock} meets the \tcode{TrivialClock} +\item the type \tcode{TC::time_point::clock} meets the \oldconcept{TrivialClock} requirements, recursively. \end{itemize} @@ -18705,15 +18706,15 @@ \end{itemdecl} \pnum -\tcode{is_clock} is a UnaryTypeTrait\iref{meta.rqmts} +\tcode{is_clock} is a \oldconcept{UnaryTypeTrait}\iref{meta.rqmts} with a base characteristic of \tcode{true_type} -if \tcode{T} meets the Clock requirements\iref{time.clock.req}, +if \tcode{T} meets the \oldconcept{Clock} requirements\iref{time.clock.req}, otherwise \tcode{false_type}. For the purposes of the specification of this trait, the extent to which an implementation determines -that a type cannot meet the Clock requirements is unspecified, +that a type cannot meet the \oldconcept{Clock} requirements is unspecified, except that as a minimum -a type \tcode{T} shall not qualify as a Clock +a type \tcode{T} shall not qualify as a \oldconcept{Clock} unless it satisfies all of the following conditions: \begin{itemize} @@ -19665,7 +19666,7 @@ \pnum \tcode{Clock} shall either -satisfy the Clock requirements\iref{time.clock.req} +satisfy the \oldconcept{Clock} requirements\iref{time.clock.req} or be the type \tcode{local_t}. \pnum @@ -20021,7 +20022,7 @@ \pnum The types defined in this subclause shall satisfy the -\tcode{TrivialClock} +\oldconcept{TrivialClock} requirements\iref{time.clock.req} unless otherwise specified. @@ -20249,7 +20250,7 @@ \end{example} \pnum -\tcode{utc_clock} is not a TrivialClock +\tcode{utc_clock} is not a \oldconcept{TrivialClock} unless the implementation can guarantee that \tcode{utc_clock::now()} does not propagate an exception. \begin{note} \tcode{noexcept(from_sys(system_clock::now()))} is \tcode{false}. \end{note} @@ -20456,7 +20457,7 @@ (22s plus the initial 10s offset). \pnum -\tcode{tai_clock} is not a TrivialClock +\tcode{tai_clock} is not a \oldconcept{TrivialClock} unless the implementation can guarantee that \tcode{tai_clock::now()} does not propagate an exception. \begin{note} @@ -20645,7 +20646,7 @@ and the additional 9 leap seconds inserted between 1970 and 1980. \pnum -\tcode{gps_clock} is not a TrivialClock +\tcode{gps_clock} is not a \oldconcept{TrivialClock} unless the implementation can guarantee that \tcode{gps_clock::now()} does not propagate an exception. \begin{note} @@ -21467,8 +21468,8 @@ but may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{day}'s unspecified internal storage. -\tcode{day} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), and participates in basic arithmetic with \tcode{days} objects, which represent a difference between two \tcode{day} objects. @@ -21757,8 +21758,8 @@ but may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{month}'s unspecified internal storage. -\tcode{month} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{month} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), and participates in basic arithmetic with \tcode{months} objects, which represent a difference between two \tcode{month} objects. @@ -22067,8 +22068,8 @@ It can represent values in the range \crange{min()}{max()}. It can be constructed with any \tcode{int} value, which will be subsequently truncated to fit into \tcode{year}'s unspecified internal storage. -\tcode{year} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), and participates in basic arithmetic with \tcode{years} objects, which represent a difference between two \tcode{year} objects. @@ -22413,10 +22414,10 @@ it may hold non-negative values outside this range. It can be constructed with any \tcode{unsigned} value, which will be subsequently truncated to fit into \tcode{weekday}'s unspecified internal storage. -\tcode{weekday} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}). +\tcode{weekday} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). \begin{note} \tcode{weekday} is not -\tcode{LessThanComparable} +\oldconcept{LessThanComparable} because there is no universal consensus on which day is the first day of the week. \tcode{weekday}'s arithmetic operations treat the days of the week as a circular range, with no beginning and no end. @@ -22977,8 +22978,8 @@ \pnum \tcode{month_day} represents a specific day of a specific month, but with an unspecified year. -\tcode{month_day} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}). +\tcode{month_day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}). \pnum \tcode{month_day} is a trivially copyable and standard-layout class type. @@ -23463,8 +23464,8 @@ \tcode{year_month} represents a specific month of a specific year, but with an unspecified day. \tcode{year_month} is a field-based time point with a resolution of \tcode{months}. -\tcode{year_month} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}). +\tcode{year_month} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}). \pnum \tcode{year_month} is a trivially copyable and standard-layout class type. @@ -23770,8 +23771,8 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_day} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year_month_day} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), \pnum \tcode{year_month_day} is a trivially copyable and standard-layout class type. @@ -24197,8 +24198,8 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_day_last} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}) -and \tcode{LessThanComparable} (Table~\ref{tab:lessthancomparable}), +\tcode{year_month_day_last} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}) +and \oldconcept{LessThanComparable} (Table~\ref{tab:lessthancomparable}), \pnum \tcode{year_month_day_last} is a trivially copyable and standard-layout class type. @@ -24497,7 +24498,7 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_weekday} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}). +\tcode{year_month_weekday} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). \pnum \tcode{year_month_weekday} is a trivially copyable and standard-layout class type. @@ -24831,7 +24832,7 @@ For the latter, there is a conversion to \tcode{sys_days}, which efficiently supports \tcode{days}-oriented arithmetic. \end{note} -\tcode{year_month_weekday_last} is \tcode{EqualityComparable} (Table~\ref{tab:equalitycomparable}). +\tcode{year_month_weekday_last} is \oldconcept{EqualityComparable} (Table~\ref{tab:equalitycomparable}). \rSec4[time.cal.ymwdlast.members]{Member functions} @@ -26351,7 +26352,7 @@ \pnum \tcode{tzdb_list::const_iterator} is a constant iterator -which meets the forward iterator requirements +which meets the \oldconcept{ForwardIterator} requirements and has a value type of \tcode{tzdb}. \indexlibrarymember{front}{tzdb_list}% @@ -28971,7 +28972,7 @@ resolution participation. \pnum -\tcode{is_execution_policy} shall be a \tcode{UnaryTypeTrait} with a +\tcode{is_execution_policy} shall be a \oldconcept{UnaryTypeTrait} with a base characteristic of \tcode{true_type} if \tcode{T} is the type of a standard or \impldef{additional execution policies supported by parallel algorithms} execution policy, otherwise \tcode{false_type}. From 2d4e82c4bd5679a4b8c1b17789150d76edcf8b29 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 13 Jun 2018 09:35:30 -0700 Subject: [PATCH 11/33] [P0898R3] Standard Library Concepts: full wording Add macro \libconcept to tag references to library concepts. --- source/algorithms.tex | 2 +- source/concepts.tex | 1305 +++++++++++++++++++++++++++++++++++++++++ source/lib-intro.tex | 92 ++- source/macros.tex | 1 + source/numerics.tex | 331 ++++++----- source/std.tex | 1 + source/utilities.tex | 207 ++++++- 7 files changed, 1770 insertions(+), 169 deletions(-) create mode 100644 source/concepts.tex diff --git a/source/algorithms.tex b/source/algorithms.tex index 788adb5bf6..e4fdbf2154 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -3108,7 +3108,7 @@ \begin{note} For the overloads with an \tcode{ExecutionPolicy}, there may be a performance cost if \tcode{iterator_traits::value_type} is not -\oldconcept{Move\-Constructible} (\tref{moveconstructible}). +\oldconcept{\-Move\-Constructible} (\tref{moveconstructible}). \end{note} \pnum diff --git a/source/concepts.tex b/source/concepts.tex new file mode 100644 index 0000000000..3382740aef --- /dev/null +++ b/source/concepts.tex @@ -0,0 +1,1305 @@ +%!TEX root = std.tex +\rSec0[concepts.lib]{Concepts library} + +\rSec1[concepts.lib.general]{General} + +\pnum +This Clause describes library components that \Cpp{} programs may use to perform +compile-time validation of template parameters and perform function dispatch +based on properties of types. The purpose of these concepts is to establish +a foundation for equational reasoning in programs. + +\pnum +The following subclauses describe core language concepts, comparison concepts, +object concepts, and callable concepts as summarized in +\tref{concepts.lib.summary}. + +\begin{libsumtab}{Fundamental concepts library summary}{tab:concepts.lib.summary} +\ref{concepts.lib.corelang} & Core language concepts & \tcode{} \\ +\ref{concepts.lib.compare} & Comparison concepts & \\ +\ref{concepts.lib.object} & Object concepts & \\ +\ref{concepts.lib.callable} & Callable concepts & \\ +\end{libsumtab} + +\rSec2[concepts.lib.general.equality]{Equality Preservation} + +\pnum +An expression is \defnx{equality preserving}{expression!equality preserving} if, +given equal inputs, the expression results in equal outputs. The inputs to an +expression are the set of the expression's operands. The output of an expression +is the expression's result and all operands modified by the expression. + +\pnum +Not all input values must be valid for a given expression; e.g., for integers +\tcode{a} and \tcode{b}, the expression \tcode{a / b} is not well-defined when +\tcode{b} is \tcode{0}. This does not preclude the expression \tcode{a / b} +being equality preserving. The \term{domain} of an expression is the set of +input values for which the expression is required to be well-defined. + +\pnum +Expressions required by this specification to be equality preserving are further +required to be stable: two evaluations of such an expression with the same input +objects must have equal outputs absent any explicit intervening modification of +those input objects. +\begin{note} +This requirement allows generic code to reason about the current values of +objects based on knowledge of the prior values as observed via equality +preserving expressions. It effectively forbids spontaneous changes to an object, +changes to an object from another thread of execution, changes to an object as +side effects of non-modifying expressions, and changes to an object as side +effects of modifying a distinct object if those changes could be observable to a +library function via an equality preserving expression that is required to be +valid for that object. +\end{note} + +\pnum +Expressions declared in a \grammarterm{requires-expression} in this document are +required to be equality preserving, except for those annotated with the comment +``not required to be equality preserving.'' An expression so annotated +may be equality preserving, but is not required to be so. + +\pnum +An expression that may alter the value of one or more of its inputs in a manner +observable to equality preserving expressions is said to modify those inputs. +This document uses a notational convention to specify which expressions declared +in a \grammarterm{requires-expression} modify which inputs: except where +otherwise specified, an expression operand that is a non-constant lvalue or +rvalue may be modified. Operands that are constant lvalues or rvalues must not +be modified. + +\pnum +Where a \grammarterm{requires-expression} declares an expression that is +non-modifying for some constant lvalue operand, additional variations of that +expression that accept a non-constant lvalue or (possibly constant) rvalue for +the given operand are also required except where such an expression variation is +explicitly required with differing semantics. These +\term{implicit expression variations} must meet the semantic requirements of the +declared expression. The extent to which an implementation validates the syntax +of the variations is unspecified. + +\begin{example} +\begin{codeblock} +template +concept C = + requires(T a, T b, const T c, const T d) { + c == d; // \#1 + a = std::move(b); // \#2 + a = c; // \#3 + }; +\end{codeblock} + +Expression \#1 does not modify either of its operands, \#2 modifies both of its +operands, and \#3 modifies only its first operand \tcode{a}. + +Expression \#1 implicitly requires additional expression variations that meet +the requirements for \tcode{c == d} (including non-modification), as if the +expressions +\begin{codeblock} +a == d; a == b; a == std::move(b); a == std::move(d); +c == a; c == std::move(a); c == std::move(d); +std::move(a) == d; std::move(a) == b; +std::move(a) == std::move(b); std::move(a) == std::move(d); +std::move(c) == b; std::move(c) == std::move(b); +std::move(c) == d; std::move(c) == std::move(d); +\end{codeblock} +had been declared as well. + +Expression \#3 implicitly requires additional expression variations that meet +the requirements for \tcode{a = c} (including non-modification of the second +operand), as if the expressions \tcode{a = b} and \tcode{a = std::move(c)} had +been declared. Expression \#3 does not implicitly require an expression +variation with a non-constant rvalue second operand, since expression \#2 +already specifies exactly such an expression explicitly. +\end{example} + +\begin{example} +The following type \tcode{T} meets the explicitly stated syntactic requirements +of concept \tcode{C} above but does not meet the additional implicit +requirements: + +\begin{codeblock} +struct T { + bool operator==(const T&) const { return true; } + bool operator==(T&) = delete; +}; +\end{codeblock} + +\tcode{T} fails to meet the implicit requirements of \tcode{C}, so \tcode{C} +is not satisfied. Since implementations are not required to validate the syntax +of implicit requirements, it is unspecified whether an implementation diagnoses +as ill-formed a program which requires \tcode{C}. +\end{example} + +\rSec1[concepts.lib.synopsis]{Header \tcode{} synopsis} + +\indexlibrary{\idxhdr{concepts}}% +\begin{codeblock} +namespace std { + // \ref{concepts.lib.corelang}, core language concepts: + // \ref{concepts.lib.corelang.same}, Same: + template + concept Same = @\seebelow@; + + // \ref{concepts.lib.corelang.derived}, DerivedFrom: + template + concept DerivedFrom = @\seebelow@; + + // \ref{concepts.lib.corelang.convertibleto}, ConvertibleTo: + template + concept ConvertibleTo = @\seebelow@; + + // \ref{concepts.lib.corelang.commonref}, CommonReference: + template + concept CommonReference = @\seebelow@; + + // \ref{concepts.lib.corelang.common}, Common: + template + concept Common = @\seebelow@; + + // \ref{concepts.lib.corelang.integral}, Integral: + template + concept Integral = @\seebelow@; + + // \ref{concepts.lib.corelang.signedintegral}, SignedIntegral: + template + concept SignedIntegral = @\seebelow@; + + // \ref{concepts.lib.corelang.unsignedintegral}, UnsignedIntegral: + template + concept UnsignedIntegral = @\seebelow@; + + // \ref{concepts.lib.corelang.assignable}, Assignable: + template + concept Assignable = @\seebelow@; + + // \ref{concepts.lib.corelang.swappable}, Swappable: + template + concept Swappable = @\seebelow@; + + template + concept SwappableWith = @\seebelow@; + + // \ref{concepts.lib.corelang.destructible}, Destructible: + template + concept Destructible = @\seebelow@; + + // \ref{concepts.lib.corelang.constructible}, Constructible: + template + concept Constructible = @\seebelow@; + + // \ref{concepts.lib.corelang.defaultconstructible}, DefaultConstructible: + template + concept DefaultConstructible = @\seebelow@; + + // \ref{concepts.lib.corelang.moveconstructible}, MoveConstructible: + template + concept MoveConstructible = @\seebelow@; + + // \ref{concepts.lib.corelang.copyconstructible}, CopyConstructible: + template + concept CopyConstructible = @\seebelow@; + + // \ref{concepts.lib.compare}, comparison concepts: + // \ref{concepts.lib.compare.boolean}, Boolean: + template + concept Boolean = @\seebelow@; + + // \ref{concepts.lib.compare.equalitycomparable}, EqualityComparable: + template + concept EqualityComparable = @\seebelow@; + + template + concept EqualityComparableWith = @\seebelow@; + + // \ref{concepts.lib.compare.stricttotallyordered}, StrictTotallyOrdered: + template + concept StrictTotallyOrdered = @\seebelow@; + + template + concept StrictTotallyOrderedWith = @\seebelow@; + + // \ref{concepts.lib.object}, object concepts: + // \ref{concepts.lib.object.movable}, Movable: + template + concept Movable = @\seebelow@; + + // \ref{concepts.lib.object.copyable}, Copyable: + template + concept Copyable = @\seebelow@; + + // \ref{concepts.lib.object.semiregular}, Semiregular: + template + concept Semiregular = @\seebelow@; + + // \ref{concepts.lib.object.regular}, Regular: + template + concept Regular = @\seebelow@; + + // \ref{concepts.lib.callable}, callable concepts: + // \ref{concepts.lib.callable.invocable}, Invocable: + template + concept Invocable = @\seebelow@; + + // \ref{concepts.lib.callable.regularinvocable}, RegularInvocable: + template + concept RegularInvocable = @\seebelow@; + + // \ref{concepts.lib.callable.predicate}, Predicate: + template + concept Predicate = @\seebelow@; + + // \ref{concepts.lib.callable.relation}, Relation: + template + concept Relation = @\seebelow@; + + // \ref{concepts.lib.callable.strictweakorder}, StrictWeakOrder: + template + concept StrictWeakOrder = @\seebelow@; +} +\end{codeblock} + +\rSec1[concepts.lib.corelang]{Core language concepts} + +\rSec2[concepts.lib.corelang.general]{General} + +\pnum +This section contains the definition of concepts corresponding to language +features. These concepts express relationships between types, type +classifications, and fundamental type properties. + +\pnum +\begin{example} +Several concept specifications in this subclause are specified in terms of a +type trait, and include an annotation that there need be no subsumption +relationship between the concept and the type trait. Given the following set of +declarations: +\begin{codeblock} +template concept C1 = is_c1_v; +template concept C2 = C1 && true; + +template void f(T); // \#1 +template void f(T); // \#2 + +template +void g(T) requires is_c1_v; // \#3 +template void g(T); // \#4 +\end{codeblock} +Since \tcode{C2} subsumes \tcode{C1}, the expression \tcode{f(42)} unambiguously +calls \#2. \tcode{g(42)}, however, is potentially ambiguous if there need be no +subsumption relationship between \tcode{C1} and \tcode{is_c1_v}. +\end{example} + +\rSec2[concepts.lib.corelang.same]{Concept \libconcept{Same}} + +\indexlibrary{\idxcode{Same}}% +\begin{itemdecl} +template +concept Same = is_same_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Same}} +and +\tcode{is_same_v}. + +\pnum +\tcode{\libconcept{Same}} subsumes \tcode{\libconcept{Same}} and +vice versa. +\end{itemdescr} + +\rSec2[concepts.lib.corelang.derived]{Concept \libconcept{DerivedFrom}} + +\indexlibrary{\idxcode{DerivedFrom}}% +\begin{itemdecl} +template +concept DerivedFrom = is_base_of_v && + is_convertible_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{DerivedFrom}} +and either +\tcode{is_base_of_v} +or +\tcode{is_convertible_v}. + +\pnum +\begin{note} +\tcode{\libconcept{DerivedFrom}} is satisfied if and only if +\tcode{Derived} is publicly and unambiguously derived from \tcode{Base}, or +\tcode{Derived} and \tcode{Base} are the same class type ignoring cv-qualifiers. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.convertibleto]{Concept \libconcept{ConvertibleTo}} + +\pnum +The \libconcept{ConvertibleTo} concept requires an expression of a particular +type and value category to be both implicitly and explicitly convertible to some +other type. The implicit and explicit conversions must produce equal results. + +\indexlibrary{\idxcode{ConvertibleTo}}% +\begin{itemdecl} +template +concept ConvertibleTo = is_convertible_v && + requires(From (&f)()) { static_cast(f()); }; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{test} be the invented function: +\begin{codeblock} +To test(From (&f)()) { + return f(); +} +\end{codeblock} +and let \tcode{f} be a function with no arguments and return type \tcode{From} +such that \tcode{f()} is equality preserving. +\tcode{\libconcept{ConvertibleTo}} is satisfied only if: + +\begin{itemize} +\item +\tcode{To} is not an object or reference-to-object type, or +\tcode{static_cast(f())} is equal to \tcode{test(f)}. + +\item +\tcode{From} is not a reference-to-object type, or + +\begin{itemize} +\item +If \tcode{From} is an rvalue reference to a non const-qualified type, the +resulting state of the object referenced by \tcode{f()} after either above +expression is valid but unspecified\iref{lib.types.movedfrom}. + +\item +Otherwise, the object referred to by \tcode{f()} is not modified by either above +expression. +\end{itemize} + +\end{itemize} + +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{ConvertibleTo}} +and +\tcode{is_\-convert\-ible_v\brk{}}. +\end{itemdescr} + + +\rSec2[concepts.lib.corelang.commonref]{Concept \libconcept{CommonReference}} + +\pnum +For two types \tcode{T} and \tcode{U}, if \tcode{common_reference_t} +is well-formed and denotes a type \tcode{C} such that both +\tcode{\libconcept{ConvertibleTo}} +and +\tcode{\libconcept{ConvertibleTo}} +are satisfied, then \tcode{T} and \tcode{U} share a +\term{common reference type}, \tcode{C}. +\begin{note} +\tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a +different type. \tcode{C} may be a reference type. +\end{note} + +\indexlibrary{\idxcode{CommonReference}}% +\begin{itemdecl} +template +concept CommonReference = + Same, common_reference_t> && + ConvertibleTo> && + ConvertibleTo>; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{C} be \tcode{common_reference_t}. Let \tcode{t} be a +function whose return type is \tcode{T}, and let \tcode{u} be a function +whose return type is \tcode{U}. \tcode{\libconcept{CommonReference}} is +satisfied only if: +\begin{itemize} +\item \tcode{C(t())} equals \tcode{C(t())} if and only if \tcode{t()} is an + equality preserving expression\iref{concepts.lib.general.equality}. +\item \tcode{C(u())} equals \tcode{C(u())} if and only if \tcode{u()} is an + equality preserving expression. +\end{itemize} + +\pnum +\begin{note} +Users can customize the behavior of \libconcept{CommonReference} by specializing +the \tcode{basic_common_reference} class template\iref{meta.trans.other}. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.common]{Concept \libconcept{Common}} + +\pnum +If \tcode{T} and \tcode{U} can both be explicitly converted to some third type, +\tcode{C}, then \tcode{T} and \tcode{U} share a \term{common type}, +\tcode{C}. +\begin{note} +\tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a +different type. \tcode{C} might not be unique. +\end{note} + +\indexlibrary{\idxcode{Common}}% +\begin{itemdecl} +template +concept Common = + Same, common_type_t> && + ConvertibleTo> && + ConvertibleTo> && + CommonReference< + add_lvalue_reference_t, + add_lvalue_reference_t> && + CommonReference< + add_lvalue_reference_t>, + common_reference_t< + add_lvalue_reference_t, + add_lvalue_reference_t>>; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{C} be \tcode{common_type_t}. Let +\tcode{t} be a function whose return type is \tcode{T}, and let \tcode{u} be a +function whose return type is \tcode{U}. \tcode{\libconcept{Common}} is +satisfied only if: +\begin{itemize} +\item \tcode{C(t())} equals \tcode{C(t())} if and only if + \tcode{t()} is an equality preserving + expression\iref{concepts.lib.general.equality}. +\item \tcode{C(u())} equals \tcode{C(u())} if and only if + \tcode{u()} is an equality preserving + expression\iref{concepts.lib.general.equality}. +\end{itemize} + +\pnum +\begin{note} +Users can customize the behavior of \libconcept{Common} by specializing the +\tcode{common_type} class template\iref{meta.trans.other}. +\end{note} + +\end{itemdescr} + +\rSec2[concepts.lib.corelang.integral]{Concept \libconcept{Integral}} + +\indexlibrary{\idxcode{Integral}}% +\begin{itemdecl} +template +concept Integral = is_integral_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Integral}} +and +\tcode{is_integral_v}. +\end{itemdescr} + +\rSec2[concepts.lib.corelang.signedintegral]{Concept \libconcept{SignedIntegral}} + +\indexlibrary{\idxcode{SignedIntegral}}% +\begin{itemdecl} +template +concept SignedIntegral = Integral && is_signed_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{SignedIntegral}} +and +\tcode{is_signed_v}. + +\pnum +\begin{note} +\tcode{\libconcept{SignedIntegral}} can be satisfied even by types that are +not signed integral types\iref{basic.fundamental}; for example, \tcode{char}. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.unsignedintegral]{Concept \libconcept{UnsignedIntegral}} + +\indexlibrary{\idxcode{UnsignedIntegral}}% +\begin{itemdecl} +template +concept UnsignedIntegral = Integral && !SignedIntegral; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\begin{note} +\tcode{\libconcept{UnsignedIntegral}} can be satisfied even by types that are +not unsigned integral types\iref{basic.fundamental}; for example, \tcode{char}. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.assignable]{Concept \libconcept{Assignable}} + +\indexlibrary{\idxcode{Assignable}}% +\begin{itemdecl} +template +concept Assignable = + is_lvalue_reference_v && + CommonReference&, const remove_reference_t&> && + requires(LHS lhs, RHS&& rhs) { + lhs = std::forward(rhs); + requires Same(rhs)), LHS>; + }; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{lhs} be an lvalue that refers to an object \tcode{lcopy} such that + \tcode{decltype((lhs))} is \tcode{LHS}, +\item \tcode{rhs} be an expression such that \tcode{decltype((rhs))} is + \tcode{RHS}, and +\item \tcode{rcopy} be a distinct object that is equal to \tcode{rhs}. +\end{itemize} +\tcode{\libconcept{Assignable}} is satisfied only if + +\begin{itemize} +\item \tcode{addressof(lhs = rhs) == addressof(lcopy)}. + +\item After evaluating \tcode{lhs = rhs}: + +\begin{itemize} +\item \tcode{lhs} is equal to \tcode{rcopy}, unless \tcode{rhs} is a non-const +xvalue that refers to \tcode{lcopy}. + +\item If \tcode{rhs} is a non-\tcode{const} xvalue, the resulting state of the +object to which it refers is valid but unspecified\iref{lib.types.movedfrom}. + +\item Otherwise, if \tcode{rhs} is a glvalue, the object to which it refers is + not modified. +\end{itemize} +\end{itemize} + +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Assignable}} +and +\tcode{is_lvalue_refer\-ence_v}. + +\pnum +\begin{note} +Assignment need not be a total function\iref{structure.requirements}; +in particular, if assignment to an object \tcode{x} can result in a modification +of some other object \tcode{y}, then \tcode{x = y} is likely not in the domain +of \tcode{=}. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.swappable]{Concept \libconcept{Swappable}} + +\indexlibrary{\idxcode{Swappable}}% +\begin{itemdecl} +template +concept Swappable = is_swappable_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{a1} and \tcode{a2} denote distinct equal objects of type \tcode{T}, +and let \tcode{b1} and \tcode{b2} similarly denote distinct equal objects of +type \tcode{T}. \tcode{\libconcept{Swappable}} is satisfied only if after +evaluating either \tcode{swap(a1, b1)} or \tcode{swap(b1, a1)} in the context +described below, \tcode{a1} is equal to \tcode{b2} and \tcode{b1} is equal to +\tcode{a2}. + +\pnum +The context in which \tcode{swap(a1, b1)} or \tcode{swap(b1, a1)} are evaluated +shall ensure that a binary non-member function named "swap" is selected via +overload resolution\iref{over.match} on a candidate set that includes: +\begin{itemize} +\item the two \tcode{swap} function templates defined in + \tcode{}\iref{utility} and +\item the lookup set produced by argument-dependent + lookup\iref{basic.lookup.argdep}. +\end{itemize} + +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Swappable}} +and +\tcode{is_swappable_v}. +\end{itemdescr} + +\indexlibrary{\idxcode{SwappableWith}}% +\begin{itemdecl} +template +concept SwappableWith = + is_swappable_with_v && is_swappable_with_v && + CommonReference&, const remove_reference_t&> && + is_swappable_with_v && is_swappable_with_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let: +\begin{itemize} +\item \tcode{t1} and \tcode{t2} denote distinct equal objects of type + \tcode{remove_cvref_t}, +\item $E_t$ be an expression that denotes \tcode{t1} such that + \tcode{decltype(($E_t$))} is \tcode{T}, +\item \tcode{u1} and \tcode{u2} similarly denote distinct equal objects of type + \tcode{remove_cvref_t}, +\item $E_u$ be an expression that denotes \tcode{u1} such that + \tcode{decltype(($E_u$))} is \tcode{U}, and +\item \tcode{C} be + \begin{codeblock} + common_reference_t&, const remove_reference_t&> + \end{codeblock} +\end{itemize} +\tcode{\libconcept{SwappableWith}} is satisfied only if after evaluating +either \tcode{swap($E_t$, $E_u$)} or \tcode{swap($E_u$, $E_t$)} in the context +described above, \tcode{C(t1)} is equal to \tcode{C(u2)} and \tcode{C(u1)} is +equal to \tcode{C(t2)}. + +\pnum +The context in which \tcode{swap($E_t$, $E_u$)} or \tcode{swap($E_u$, $E_t$)} +are evaluated shall ensure that a binary non-member function named "swap" is +selected via overload resolution\iref{over.match} on a candidate set that +includes: +\begin{itemize} +\item the two \tcode{swap} function templates defined in + \tcode{}\iref{utility} and +\item the lookup set produced by argument-dependent + lookup\iref{basic.lookup.argdep}. +\end{itemize} + +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{SwappableWith}} +and any specialization of +\tcode{is_swappable_with_v}. +\end{itemdescr} + +\begin{itemdescr} +\pnum +This subclause provides definitions for swappable types and expressions. In +these definitions, let \tcode{t} denote an expression of type \tcode{T}, and let +\tcode{u} denote an expression of type \tcode{U}. + +\pnum +An object \tcode{t} is \defn{swappable with} an object \tcode{u} if and only if +\tcode{\libconcept{SwappableWith}} is satisfied. +\tcode{Swappable\-With} is satisfied only if given distinct objects +\tcode{t2} equal to \tcode{t} and \tcode{u2} equal to \tcode{u}, after +evaluating either \tcode{ranges::swap(t, u)} or \tcode{ranges::swap(u, t)}, +\tcode{t2} is equal to \tcode{u} and \tcode{u2} is equal to \tcode{t}. + +\pnum +An rvalue or lvalue \tcode{t} is \defn{swappable} if and only if \tcode{t} is +swappable with any rvalue or lvalue, respectively, of type \tcode{T}. + +\begin{example} +User code can ensure that the evaluation of \tcode{swap} calls +is performed in an appropriate context under the various conditions as follows: +\begin{codeblock} +#include + +template U> +void value_swap(T&& t, U&& u) { + using std::swap; + swap(std::forward(t), std::forward(u)); // OK: uses ``swappable with'' conditions + // for rvalues and lvalues +} + +template +void lv_swap(T& t1, T& t2) { + using std::swap; + swap(t1, t2); // OK: uses swappable conditions for +} // lvalues of type \tcode{T} + +namespace N { + struct A { int m; }; + struct Proxy { A* a; }; + Proxy proxy(A& a) { return Proxy{ &a }; } + + void swap(A& x, Proxy p) { + std::swap(x.m, p.a->m); // OK: uses context equivalent to swappable + // conditions for fundamental types + } + void swap(Proxy p, A& x) { swap(x, p); } // satisfy symmetry constraint +} + +int main() { + int i = 1, j = 2; + lv_swap(i, j); + assert(i == 2 && j == 1); + + N::A a1 = { 5 }, a2 = { -5 }; + value_swap(a1, proxy(a2)); + assert(a1.m == -5 && a2.m == 5); +} +\end{codeblock} +\end{example} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.destructible]{Concept \libconcept{Destructible}} + +\pnum +The \libconcept{Destructible} concept specifies properties of all types, +instances of which can be destroyed at the end of their lifetime, or reference +types. + +\indexlibrary{\idxcode{Destructible}}% +\begin{itemdecl} +template +concept Destructible = is_nothrow_destructible_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Destructible}} +and +\tcode{is_\-no\-throw_\-destruct\-ible_v}. + +\pnum +\begin{note} +Unlike the \oldconcept{Destructible} requirements~(\tref{destructible}), this +concept forbids destructors that are potentially throwing, even if non-throwing. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.constructible]{Concept \libconcept{Constructible}} + +\pnum +The \libconcept{Constructible} concept constrains the initialization of a +variable of a given type with a particular set of argument types. + +\indexlibrary{\idxcode{Constructible}}% +\begin{itemdecl} +template +concept Constructible = Destructible && is_constructible_v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Constructible}} +and +\tcode{is_const\-ruct\-ible_v}. +\end{itemdescr} + +\rSec2[concepts.lib.corelang.defaultconstructible]{Concept \libconcept{DefaultConstructible}} + +\indexlibrary{\idxcode{DefaultConstructible}}% +\begin{itemdecl} +template +concept DefaultConstructible = Constructible; +\end{itemdecl} + +\rSec2[concepts.lib.corelang.moveconstructible]{Concept \libconcept{MoveConstructible}} + +\indexlibrary{\idxcode{MoveConstructible}}% +\begin{itemdecl} +template +concept MoveConstructible = Constructible && ConvertibleTo; +\end{itemdecl} + +\begin{itemdescr} +\pnum +If \tcode{T} is an object type, then let \tcode{rv} be an rvalue of type +\tcode{T} and \tcode{u2} a distinct object of type \tcode{T} equal to +\tcode{rv}. \tcode{\libconcept{MoveConstructible}} is satisfied only if + +\begin{itemize} +\item After the definition \tcode{T u = rv;}, \tcode{u} is equal to \tcode{u2}. + +\item \tcode{T(rv)} is equal to \tcode{u2}. + +\item If \tcode{T} is not \tcode{const}, \tcode{rv}'s resulting state is valid +but unspecified\iref{lib.types.movedfrom}; otherwise, it is unchanged. +\end{itemize} +\end{itemdescr} + +\rSec2[concepts.lib.corelang.copyconstructible]{Concept \libconcept{CopyConstructible}} + +\indexlibrary{\idxcode{CopyConstructible}}% +\begin{itemdecl} +template +concept CopyConstructible = MoveConstructible && + Constructible && ConvertibleTo && + Constructible && ConvertibleTo && + Constructible && ConvertibleTo; +\end{itemdecl} + +\begin{itemdescr} +\pnum +If \tcode{T} is an object type, then let \tcode{v} be an lvalue of type +(possibly \tcode{const}) \tcode{T} or an rvalue of type \tcode{const T}. +\tcode{\libconcept{CopyConstructible}} is satisfied only if + +\begin{itemize} +\item After the definition \tcode{T u = v;}, \tcode{u} is equal to \tcode{v}. + +\item \tcode{T(v)} is equal to \tcode{v}. +\end{itemize} + +\end{itemdescr} + +\rSec1[concepts.lib.compare]{Comparison concepts} + +\rSec2[concepts.lib.compare.general]{General} + +\pnum +This section describes concepts that establish relationships and orderings +on values of possibly differing object types. + +\rSec2[concepts.lib.compare.boolean]{Concept \libconcept{Boolean}} + +\pnum +The \libconcept{Boolean} concept specifies the requirements on a type that is +usable in Boolean contexts. + +\indexlibrary{\idxcode{Boolean}}% +\begin{itemdecl} +template +concept Boolean = Movable> && // (see \ref{concepts.lib.object.movable}) + requires(const remove_reference_t& b1, + const remove_reference_t& b2, const bool a) { + requires ConvertibleTo&, bool>; + !b1; requires ConvertibleTo; + b1 && a; requires Same; + b1 || a; requires Same; + b1 && b2; requires Same; + a && b2; requires Same; + b1 || b2; requires Same; + a || b2; requires Same; + b1 == b2; requires ConvertibleTo; + b1 == a; requires ConvertibleTo; + a == b2; requires ConvertibleTo; + b1 != b2; requires ConvertibleTo; + b1 != a; requires ConvertibleTo; + a != b2; requires ConvertibleTo; + }; +\end{itemdecl} + +\pnum +Given lvalues \tcode{b1} and \tcode{b2} of type +\tcode{const remove_reference_t}, +then \tcode{\libconcept{Boolean}} is satisfied only if + +\begin{itemize} +\item \tcode{bool(b1) == !bool(!b1)}. +\item \tcode{(b1 \&\& b2)}, \tcode{(b1 \&\& bool(b2))}, and + \tcode{(bool(b1) \&\& b2)} are all equal to + \tcode{(bool(b1) \&\& bool(b2))}, and have the same short-circuit + evaluation. +\item \tcode{(b1 || b2)}, \tcode{(b1 || bool(b2))}, and + \tcode{(bool(b1) || b2)} are all equal to + \tcode{(bool(b1) || bool(b2))}, and have the same short-circuit + evaluation. +\item \tcode{bool(b1 == b2)}, \tcode{bool(b1 == bool(b2))}, and + \tcode{bool(bool(b1) == b2)} are all equal to + \tcode{(bool(b1) == bool(b2))}. +\item \tcode{bool(b1 != b2)}, \tcode{bool(b1 != bool(b2))}, and + \tcode{bool(bool(b1) != b2)} are all equal to + \tcode{(bool(b1) != bool(b2))}. +\end{itemize} + +\pnum +\begin{example} +The types \tcode{bool}, \tcode{true_type}\iref{meta.type.synop}, and +\tcode{bitset<$N$>::reference}\iref{template.bitset} are \libconcept{Boolean} +types. Pointers, smart pointers, and types with only explicit conversions to +\tcode{bool} are not \libconcept{Boolean} types. +\end{example} + +\rSec2[concepts.lib.compare.equalitycomparable]{Concept \libconcept{EqualityComparable}} + +\begin{itemdecl} +template +concept @\placeholder{weakly-equality-comparable-with}@ = // \expos + requires(const remove_reference_t& t, + const remove_reference_t& u) { + t == u; requires Boolean; + t != u; requires Boolean; + u == t; requires Boolean; + u != t; requires Boolean; + }; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{t} and \tcode{u} be lvalues of types +\tcode{const remove_reference_t} and +\tcode{const remove_reference_t} respectively. +\tcode{\placeholder{weakly-equality-comparable-with}} +is satisfied only if: +\begin{itemize} +\item \tcode{t == u}, \tcode{u == t}, \tcode{t != u}, and \tcode{u != t} + have the same domain. +\item \tcode{bool(u == t) == bool(t == u)}. +\item \tcode{bool(t != u) == !bool(t == u)}. +\item \tcode{bool(u != t) == bool(t != u)}. +\end{itemize} +\end{itemdescr} + +\indexlibrary{\idxcode{EqualityComparable}}% +\begin{itemdecl} +template +concept EqualityComparable = @\placeholder{weakly-equality-comparable-with}@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{a} and \tcode{b} be objects of type \tcode{T}. +\tcode{\libconcept{EqualityComparable}} is satisfied only if +\tcode{bool(a == b)} is \tcode{true} when \tcode{a} is equal to +\tcode{b}\iref{concepts.lib.general.equality}, and \tcode{false} otherwise. + +\pnum +\begin{note} +The requirement that the expression \tcode{a == b} is equality preserving +implies that \tcode{==} is reflexive, transitive, and symmetric. +\end{note} +\end{itemdescr} + +\indexlibrary{\idxcode{EqualityComparableWith}}% +\begin{itemdecl} +template +concept EqualityComparableWith = + EqualityComparable && EqualityComparable && + CommonReference&, const remove_reference_t&> && + EqualityComparable< + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>> && + @\placeholder{weakly-equality-comparable-with}@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, +\tcode{u} be an lvalue of type \tcode{const remove_reference_t}, +and \tcode{C} be: +\begin{codeblock} +common_reference_t&, const remove_reference_t&> +\end{codeblock} +\tcode{\libconcept{EqualityComparableWith}} is satisfied only if +\tcode{bool(t == u) == bool(C(t) == C(u))}. +\end{itemdescr} + +\rSec2[concepts.lib.compare.stricttotallyordered]{Concept \libconcept{StrictTotallyOrdered}} + +\indexlibrary{\idxcode{StrictTotallyOrdered}}% +\begin{itemdecl} +template +concept StrictTotallyOrdered = EqualityComparable && + requires(const remove_reference_t& a, + const remove_reference_t& b) { + a < b; requires Boolean; + a > b; requires Boolean b)>; + a <= b; requires Boolean; + a >= b; requires Boolean= b)>; + }; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{a}, \tcode{b}, and \tcode{c} be lvalues of type +\tcode{const remove_reference_t}. +\tcode{\libconcept{StrictTotallyOrdered}} is satisfied only if + +\begin{itemize} +\item Exactly one of \tcode{bool(a < b)}, \tcode{bool(a > b)}, or + \tcode{bool(a == b)} is \tcode{true}. +\item If \tcode{bool(a < b)} and \tcode{bool(b < c)}, then + \tcode{bool(a < c)}. +\item \tcode{bool(a > b) == bool(b < a)}. +\item \tcode{bool(a <= b) == !bool(b < a)}. +\item \tcode{bool(a >= b) == !bool(a < b)}. +\end{itemize} + +\end{itemdescr} + +\begin{itemdecl} +template +concept StrictTotallyOrderedWith = StrictTotallyOrdered && StrictTotallyOrdered && + CommonReference&, const remove_reference_t&> && + StrictTotallyOrdered< + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>> && + EqualityComparableWith && + requires(const remove_reference_t& t, + const remove_reference_t& u) { + t < u; requires Boolean; + t > u; requires Boolean u)>; + t <= u; requires Boolean; + t >= u; requires Boolean= u)>; + u < t; requires Boolean; + u > t; requires Boolean t)>; + u <= t; requires Boolean; + u >= t; requires Boolean= t)>; + }; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{t} be an lvalue of type \tcode{const remove_reference_t}, +\tcode{u} be an lvalue of type \tcode{const remove_reference_t}, +and \tcode{C} be: +\begin{codeblock} +common_reference_t&, const remove_reference_t&> +\end{codeblock} +\tcode{\libconcept{StrictTotallyOrderedWith}} is satisfied only if + +\begin{itemize} +\item \tcode{bool(t < u) == bool(C(t) < C(u)).} +\item \tcode{bool(t > u) == bool(C(t) > C(u)).} +\item \tcode{bool(t <= u) == bool(C(t) <= C(u)).} +\item \tcode{bool(t >= u) == bool(C(t) >= C(u)).} +\item \tcode{bool(u < t) == bool(C(u) < C(t)).} +\item \tcode{bool(u > t) == bool(C(u) > C(t)).} +\item \tcode{bool(u <= t) == bool(C(u) <= C(t)).} +\item \tcode{bool(u >= t) == bool(C(u) >= C(t)).} +\end{itemize} +\end{itemdescr} + +\rSec1[concepts.lib.object]{Object concepts} + +\rSec2[concepts.lib.object.general]{General} +\pnum +This section describes concepts that specify the basis of the +value-oriented programming style on which the library is based. + +\rSec2[concepts.lib.object.movable]{Concept \libconcept{Movable}} + +\indexlibrary{\idxcode{Movable}}% +\begin{itemdecl} +template +concept Movable = is_object_v && MoveConstructible && Assignable && Swappable; +\end{itemdecl} + +\begin{itemdescr} +\pnum +There need be no subsumption relationship between +\tcode{\libconcept{Movable}} +and +\tcode{is_object_v}. +\end{itemdescr} + +\rSec2[concepts.lib.object.copyable]{Concept \libconcept{Copyable}} + +\indexlibrary{\idxcode{Copyable}}% +\begin{itemdecl} +template +concept Copyable = CopyConstructible && Movable && Assignable; +\end{itemdecl} + +\rSec2[concepts.lib.object.semiregular]{Concept \libconcept{Semiregular}} + +\indexlibrary{\idxcode{Semiregular}}% +\begin{itemdecl} +template +concept Semiregular = Copyable && DefaultConstructible; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\begin{note} +The \libconcept{Semiregular} concept is satisfied by types that behave similarly +to built-in types like \tcode{int}, except that they might not +be comparable with \tcode{==}. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.object.regular]{Concept \libconcept{Regular}} + +\indexlibrary{\idxcode{Regular}}% +\begin{itemdecl} +template +concept Regular = Semiregular && EqualityComparable; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\begin{note} +The \libconcept{Regular} concept is satisfied by types that behave similarly to +built-in types like \tcode{int} and that are comparable with +\tcode{==}. +\end{note} +\end{itemdescr} + +\rSec1[concepts.lib.callable]{Callable concepts} + +\rSec2[concepts.lib.callable.general]{General} + +\pnum +The concepts in this section describe the requirements on function +objects\iref{function.objects} and their arguments. + +\rSec2[concepts.lib.callable.invocable]{Concept \libconcept{Invocable}} + +\pnum +The \libconcept{Invocable} concept specifies a relationship between a callable +type\iref{func.def} \tcode{F} and a set of argument types \tcode{Args...} which +can be evaluated by the library function \tcode{invoke}\iref{func.invoke}. + +\indexlibrary{\idxcode{Invocable}}% +\begin{itemdecl} +template +concept Invocable = requires(F&& f, Args&&... args) { + invoke(std::forward(f), std::forward(args)...); // not required to be equality preserving +}; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\begin{example} +A function that generates random numbers can satisfy \libconcept{Invocable}, +since the \tcode{invoke} function call expression is not required to be +equality-preserving\iref{concepts.lib.general.equality}. +\end{example} +\end{itemdescr} + +\rSec2[concepts.lib.callable.regularinvocable]{Concept \libconcept{RegularInvocable}} + +\indexlibrary{\idxcode{RegularInvocable}}% +\begin{itemdecl} +template +concept RegularInvocable = Invocable; +\end{itemdecl} + +\begin{itemdescr} +\pnum +The \tcode{invoke} function call expression shall be equality-preserving and +shall not modify the function object or the +arguments\iref{concepts.lib.general.equality}. +\begin{note} +This requirement supersedes the annotation in the definition of +\libconcept{Invocable}. +\end{note} + +\pnum +\begin{example} +A random number generator does not satisfy +\libconcept{RegularInvocable}. +\end{example} + +\pnum +\begin{note} +The distinction between \libconcept{Invocable} and \libconcept{RegularInvocable} +is purely semantic. +\end{note} +\end{itemdescr} + +\rSec2[concepts.lib.callable.predicate]{Concept \libconcept{Predicate}} + +\indexlibrary{\idxcode{Predicate}}% +\begin{itemdecl} +template +concept Predicate = RegularInvocable && + Boolean>; +\end{itemdecl} + +\rSec2[concepts.lib.callable.relation]{Concept \libconcept{Relation}} + +\indexlibrary{\idxcode{Relation}}% +\begin{itemdecl} +template +concept Relation = Predicate && Predicate && + CommonReference&, const remove_reference_t&> && + Predicate&, const remove_reference_t&>, + common_reference_t&, const remove_reference_t&>> && + Predicate && Predicate; +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let +\begin{itemize} +\item \tcode{r} be an expression such that \tcode{decltype((r))} is \tcode{R}, +\item \tcode{t} be an expression such that \tcode{decltype((t))} is \tcode{T}, +\item \tcode{u} be an expression such that \tcode{decltype((u))} is \tcode{U}, + and +\item \tcode{C} be + \begin{codeblock} + common_reference_t&, + const remove_reference_t&> + \end{codeblock} +\end{itemize} +\tcode{\libconcept{Relation}} is satisfied only if + +\begin{itemize} +\item \tcode{bool(r(t, u)) == bool(r(C(t), C(u))).} +\item \tcode{bool(r(u, t)) == bool(r(C(u), C(t))).} +\end{itemize} +\end{itemdescr} + +\rSec2[concepts.lib.callable.strictweakorder]{Concept \libconcept{StrictWeakOrder}} + +\indexlibrary{\idxcode{Relation}}% +\begin{itemdecl} +template +concept StrictWeakOrder = Relation; +\end{itemdecl} + +\begin{itemdescr} +\pnum +A \libconcept{Relation} satisfies \libconcept{StrictWeakOrder} only if +it imposes a \term{strict weak ordering} on its arguments. + +\pnum +The term +\term{strict} +refers to the +requirement of an irreflexive relation (\tcode{!comp(x, x)} for all \tcode{x}), +and the term +\term{weak} +to requirements that are not as strong as +those for a total ordering, +but stronger than those for a partial +ordering. +If we define +\tcode{equiv(a, b)} +as +\tcode{!comp(a, b) \&\& !comp(b, a)}, +then the requirements are that +\tcode{comp} +and +\tcode{equiv} +both be transitive relations: + +\begin{itemize} +\item +\tcode{comp(a, b) \&\& comp(b, c)} +implies +\tcode{comp(a, c)} +\item +\tcode{equiv(a, b) \&\& equiv(b, c)} +implies +\tcode{equiv(a, c)} +\end{itemize} + +\pnum +\begin{note} +Under these conditions, it can be shown that +\begin{itemize} +\item +\tcode{equiv} +is an equivalence relation +\item +\tcode{comp} +induces a well-defined relation on the equivalence +classes determined by +\tcode{equiv} +\item +The induced relation is a strict total ordering. +\end{itemize} +\end{note} +\end{itemdescr} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index da693ac9fb..4bb2c8ab96 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -24,6 +24,7 @@ \begin{libsumtabbase}{Library categories}{tab:library.categories}{Clause}{Category} \ref{language.support} & & Language support library \\ +\ref{concepts.lib} & & Concepts library \\ \ref{diagnostics} & & Diagnostics library \\ \ref{utilities} & & General utilities library \\ \ref{strings} & & Strings library \\ @@ -43,6 +44,11 @@ required by certain parts of the \Cpp{} language, such as memory allocation~(\ref{expr.new}, \ref{expr.delete}) and exception processing\iref{except}. +\pnum +The concepts library\iref{concepts.lib} describes library components that \Cpp{} +programs may use to perform compile-time validation of template parameters and +perform function dispatch based on properties of types. + \pnum The diagnostics library\iref{diagnostics} provides a consistent framework for reporting errors in a \Cpp{} program, including predefined exception classes. @@ -219,6 +225,19 @@ direct-initialization\iref{dcl.init} that is not list-initialization\iref{dcl.init.list} +\definition{expression-equivalent}{defns.expression-equivalent} +\indexdefn{expression-equivalent}% +relationship that exists between two expressions \tcode{E1} and \tcode{E2} such +that +\begin{itemize} +\item \tcode{E1} and \tcode{E2} have the same effects, + +\item \tcode{noexcept(E1) == noexcept(E2)}, and + +\item \tcode{E1} is a constant subexpression if and only if \tcode{E2} is a +constant subexpression +\end{itemize} + \definition{handler function}{defns.handler} \indexdefn{function!handler}% non-reserved function whose definition may be provided by a \Cpp{} program @@ -419,6 +438,7 @@ \item classes and class templates \item functions and function templates \item objects +\item concepts \end{itemize} \rSec3[structure.requirements]{Requirements} @@ -431,7 +451,8 @@ \begin{itemize} \item Template arguments \item Derived classes -\item Containers, iterators, and algorithms that meet an interface convention +\item Containers, iterators, and algorithms that meet an interface convention or + satisfy a concept \end{itemize} \pnum @@ -448,7 +469,7 @@ \pnum Requirements are stated in terms of well-defined expressions that define valid terms of the types that satisfy the requirements. For every set of well-defined expression -requirements there is a table that specifies an initial set of the valid expressions and +requirements there is either a named concept or a table that specifies an initial set of the valid expressions and their semantics. Any generic algorithm\iref{algorithms} that uses the well-defined expression requirements is described in terms of the valid expressions for its template type parameters. @@ -465,6 +486,23 @@ must be implemented.\footnote{Although in some cases the code given is unambiguously the optimum implementation.} +\pnum +Required operations of any concept defined in this document need not be +total functions; that is, some arguments to a required operation may +result in the required semantics failing to be satisfied. +\begin{example} +The required \tcode{<} operator of the \libconcept{StrictTotallyOrdered} +concept\iref{concepts.lib.compare.stricttotallyordered} does not meet the +semantic requirements of that concept when operating on NaNs. +\end{example} +This does not affect whether a type satisfies the concept. + +\pnum +A declaration may explicitly impose requirements through its associated +constraints\iref{temp.constr.decl}. When the associated constraints refer to a +concept\iref{temp.concept}, additional semantic requirements are imposed on the +use of the declaration. + \rSec3[structure.specifications]{Detailed specifications} \pnum @@ -893,6 +931,47 @@ A \defnx{static \ntmbs{}}{NTMBS@\ntmbs{}!static} is an \ntmbs{} with static storage duration. +\rSec4[customization.point.object]{Customization Point Object types} + +\pnum +A \term{customization point object} is a function object\iref{function.objects} +with a literal class type that interacts with user-defined types while enforcing +semantic requirements on that interaction. + +\pnum +The type of a customization point object shall satisfy +\libconcept{Semiregular}\iref{concepts.lib.object.semiregular}. + +\pnum +All instances of a specific customization point object type shall +be equal\iref{concepts.lib.general.equality}. + +\pnum +The type \tcode{T} of a customization point object shall satisfy +\tcode{\libconcept{Invocable}}\iref{concepts.lib.callable.invocable} +when the types in \tcode{Args...} meet the requirements specified in that +customization point object's definition. When the types of \tcode{Args...} do +not meet the customization point object's requirements, \tcode{T} shall not have +a function call operator that participates in overload resolution. + +\pnum +Each customization point object type constrains its return type to satisfy a +particular concept. + +\pnum +\begin{note} +Many of the customization point objects in the library evaluate function call +expressions with an unqualified name which results in a call to a user-defined +function found by argument dependent name lookup\iref{basic.lookup.argdep}. To +preclude such an expression resulting in a call to unconstrained functions with +the same name in namespace \tcode{std}, customization point objects specify that +lookup for these expressions is performed in a context that includes deleted +overloads matching the signatures of overloads defined in namespace \tcode{std}. +When the deleted overloads are viable, user-defined overloads must be more +specialized\iref{temp.func.order} or more constrained\iref{temp.constr.order} to +be used by a customization point object. +\end{note} + \rSec3[functions.within.classes]{Functions within classes} \pnum @@ -1088,6 +1167,7 @@ \tcode{} \\ \tcode{} \\ \tcode{} \\ +\tcode{} \\ \tcode{} \\ \tcode{} \\ \tcode{} \\ @@ -2751,7 +2831,7 @@ paragraph. \item if an incomplete type\iref{basic.types} is used as a template -argument when instantiating a template component, unless specifically +argument when instantiating a template component or evaluating a concept, unless specifically allowed for that component. \end{itemize} @@ -2834,6 +2914,12 @@ in a function's \expects element results in undefined behavior. +\rSec3[res.on.requirements]{Semantic requirements} +\pnum +If the semantic requirements of a declaration's +constraints\iref{structure.requirements} are not satisfied at the point of use, +the program is ill-formed, no diagnostic required. + \rSec2[conforming]{Conforming implementations} \rSec3[conforming.overview]{Overview} diff --git a/source/macros.tex b/source/macros.tex index ee7fb9176a..14ae54a9b4 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -318,6 +318,7 @@ %% Concepts \newcommand{\oldconcept}[1]{\textit{Cpp98#1}} +\newcommand{\libconcept}[1]{\tcode{#1}} %% Ranges \newcommand{\Range}[4]{\tcode{#1#3,\penalty2000{} #4#2}} diff --git a/source/numerics.tex b/source/numerics.tex index b83c0b538c..1d9c2acaf3 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1608,6 +1608,160 @@ \end{enumeratea} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Header synopsis subclause +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\rSec2[rand.synopsis]{Header \tcode{} synopsis}% +\indexhdr{random} +\indextext{random number generation!synopsis|(} + +\begin{codeblock} +#include + +namespace std { + // \ref{rand.req.urng}, concept UniformRandomBitGenerator + template + concept UniformRandomBitGenerator = @\seebelow@; + + // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} + template + class linear_congruential_engine; + + // \ref{rand.eng.mers}, class template \tcode{mersenne_twister_engine} + template + class mersenne_twister_engine; + + // \ref{rand.eng.sub}, class template \tcode{subtract_with_carry_engine} + template + class subtract_with_carry_engine; + + // \ref{rand.adapt.disc}, class template \tcode{discard_block_engine} + template + class discard_block_engine; + + // \ref{rand.adapt.ibits}, class template \tcode{independent_bits_engine} + template + class independent_bits_engine; + + // \ref{rand.adapt.shuf}, class template \tcode{shuffle_order_engine} + template + class shuffle_order_engine; + + // \ref{rand.predef}, engines and engine adaptors with predefined parameters + using minstd_rand0 = @\seebelow@; + using minstd_rand = @\seebelow@; + using mt19937 = @\seebelow@; + using mt19937_64 = @\seebelow@; + using ranlux24_base = @\seebelow@; + using ranlux48_base = @\seebelow@; + using ranlux24 = @\seebelow@; + using ranlux48 = @\seebelow@; + using knuth_b = @\seebelow@; + + using default_random_engine = @\seebelow@; + + // \ref{rand.device}, class \tcode{random_device} + class random_device; + + // \ref{rand.util.seedseq}, class \tcode{seed_seq} + class seed_seq; + + // \ref{rand.util.canonical}, function template \tcode{generate_canonical} + template + RealType generate_canonical(URBG& g); + + // \ref{rand.dist.uni.int}, class template \tcode{uniform_int_distribution} + template + class uniform_int_distribution; + + // \ref{rand.dist.uni.real}, class template \tcode{uniform_real_distribution} + template + class uniform_real_distribution; + + // \ref{rand.dist.bern.bernoulli}, class \tcode{bernoulli_distribution} + class bernoulli_distribution; + + // \ref{rand.dist.bern.bin}, class template \tcode{binomial_distribution} + template + class binomial_distribution; + + // \ref{rand.dist.bern.geo}, class template \tcode{geometric_distribution} + template + class geometric_distribution; + + // \ref{rand.dist.bern.negbin}, class template \tcode{negative_binomial_distribution} + template + class negative_binomial_distribution; + + // \ref{rand.dist.pois.poisson}, class template \tcode{poisson_distribution} + template + class poisson_distribution; + + // \ref{rand.dist.pois.exp}, class template \tcode{exponential_distribution} + template + class exponential_distribution; + + // \ref{rand.dist.pois.gamma}, class template \tcode{gamma_distribution} + template + class gamma_distribution; + + // \ref{rand.dist.pois.weibull}, class template \tcode{weibull_distribution} + template + class weibull_distribution; + + // \ref{rand.dist.pois.extreme}, class template \tcode{extreme_value_distribution} + template + class extreme_value_distribution; + + // \ref{rand.dist.norm.normal}, class template \tcode{normal_distribution} + template + class normal_distribution; + + // \ref{rand.dist.norm.lognormal}, class template \tcode{lognormal_distribution} + template + class lognormal_distribution; + + // \ref{rand.dist.norm.chisq}, class template \tcode{chi_squared_distribution} + template + class chi_squared_distribution; + + // \ref{rand.dist.norm.cauchy}, class template \tcode{cauchy_distribution} + template + class cauchy_distribution; + + // \ref{rand.dist.norm.f}, class template \tcode{fisher_f_distribution} + template + class fisher_f_distribution; + + // \ref{rand.dist.norm.t}, class template \tcode{student_t_distribution} + template + class student_t_distribution; + + // \ref{rand.dist.samp.discrete}, class template \tcode{discrete_distribution} + template + class discrete_distribution; + + // \ref{rand.dist.samp.pconst}, class template \tcode{piecewise_constant_distribution} + template + class piecewise_constant_distribution; + + // \ref{rand.dist.samp.plinear}, class template \tcode{piecewise_linear_distribution} + template + class piecewise_linear_distribution; +} +\end{codeblock}% +\indextext{random number generation!synopsis|)}% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% @@ -1935,6 +2089,33 @@ \indextext{requirements!uniform random bit generator|)}% \indextext{uniform random bit generator!requirements|)} +\pnum +The \libconcept{UniformRandomBitGenerator} concept is a slight relaxation of the +uniform random bit generator requirements, in that it does not require a nested +\grammarterm{typedef-name} \tcode{result_type}. + +\begin{codeblock} +template +concept UniformRandomBitGenerator = + Invocable && UnsignedIntegral> && + requires { + G::min(); requires Same>; + G::max(); requires Same>; + }; +\end{codeblock} + +\pnum +Let \tcode{g} be an object of type \tcode{G}. +\tcode{\libconcept{UniformRandomBitGenerator}} is satisfied only if + +\begin{itemize} +\item Both \tcode{G::min()} and \tcode{G::max()} are constant + expressions\iref{expr.const}. +\item \tcode{G::min() < G::max()}. +\item \tcode{G::min() <= g()}. +\item \tcode{g() <= G::max()}. +\item \tcode{g()} has amortized constant complexity. +\end{itemize} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Random Number Engine requirements: @@ -2640,156 +2821,6 @@ \indextext{random number generation!requirements|)} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% -%% Header synopsis subclause -%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\rSec2[rand.synopsis]{Header \tcode{} synopsis}% -\indexhdr{random} -\indextext{random number generation!synopsis|(} - -\begin{codeblock} -#include - -namespace std { - // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} - template - class linear_congruential_engine; - - // \ref{rand.eng.mers}, class template \tcode{mersenne_twister_engine} - template - class mersenne_twister_engine; - - // \ref{rand.eng.sub}, class template \tcode{subtract_with_carry_engine} - template - class subtract_with_carry_engine; - - // \ref{rand.adapt.disc}, class template \tcode{discard_block_engine} - template - class discard_block_engine; - - // \ref{rand.adapt.ibits}, class template \tcode{independent_bits_engine} - template - class independent_bits_engine; - - // \ref{rand.adapt.shuf}, class template \tcode{shuffle_order_engine} - template - class shuffle_order_engine; - - // \ref{rand.predef}, engines and engine adaptors with predefined parameters - using minstd_rand0 = @\seebelow@; - using minstd_rand = @\seebelow@; - using mt19937 = @\seebelow@; - using mt19937_64 = @\seebelow@; - using ranlux24_base = @\seebelow@; - using ranlux48_base = @\seebelow@; - using ranlux24 = @\seebelow@; - using ranlux48 = @\seebelow@; - using knuth_b = @\seebelow@; - - using default_random_engine = @\seebelow@; - - // \ref{rand.device}, class \tcode{random_device} - class random_device; - - // \ref{rand.util.seedseq}, class \tcode{seed_seq} - class seed_seq; - - // \ref{rand.util.canonical}, function template \tcode{generate_canonical} - template - RealType generate_canonical(URBG& g); - - // \ref{rand.dist.uni.int}, class template \tcode{uniform_int_distribution} - template - class uniform_int_distribution; - - // \ref{rand.dist.uni.real}, class template \tcode{uniform_real_distribution} - template - class uniform_real_distribution; - - // \ref{rand.dist.bern.bernoulli}, class \tcode{bernoulli_distribution} - class bernoulli_distribution; - - // \ref{rand.dist.bern.bin}, class template \tcode{binomial_distribution} - template - class binomial_distribution; - - // \ref{rand.dist.bern.geo}, class template \tcode{geometric_distribution} - template - class geometric_distribution; - - // \ref{rand.dist.bern.negbin}, class template \tcode{negative_binomial_distribution} - template - class negative_binomial_distribution; - - // \ref{rand.dist.pois.poisson}, class template \tcode{poisson_distribution} - template - class poisson_distribution; - - // \ref{rand.dist.pois.exp}, class template \tcode{exponential_distribution} - template - class exponential_distribution; - - // \ref{rand.dist.pois.gamma}, class template \tcode{gamma_distribution} - template - class gamma_distribution; - - // \ref{rand.dist.pois.weibull}, class template \tcode{weibull_distribution} - template - class weibull_distribution; - - // \ref{rand.dist.pois.extreme}, class template \tcode{extreme_value_distribution} - template - class extreme_value_distribution; - - // \ref{rand.dist.norm.normal}, class template \tcode{normal_distribution} - template - class normal_distribution; - - // \ref{rand.dist.norm.lognormal}, class template \tcode{lognormal_distribution} - template - class lognormal_distribution; - - // \ref{rand.dist.norm.chisq}, class template \tcode{chi_squared_distribution} - template - class chi_squared_distribution; - - // \ref{rand.dist.norm.cauchy}, class template \tcode{cauchy_distribution} - template - class cauchy_distribution; - - // \ref{rand.dist.norm.f}, class template \tcode{fisher_f_distribution} - template - class fisher_f_distribution; - - // \ref{rand.dist.norm.t}, class template \tcode{student_t_distribution} - template - class student_t_distribution; - - // \ref{rand.dist.samp.discrete}, class template \tcode{discrete_distribution} - template - class discrete_distribution; - - // \ref{rand.dist.samp.pconst}, class template \tcode{piecewise_constant_distribution} - template - class piecewise_constant_distribution; - - // \ref{rand.dist.samp.plinear}, class template \tcode{piecewise_linear_distribution} - template - class piecewise_linear_distribution; -} -\end{codeblock}% -\indextext{random number generation!synopsis|)}% - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% diff --git a/source/std.tex b/source/std.tex index 7d3c73923b..0d27e26745 100644 --- a/source/std.tex +++ b/source/std.tex @@ -116,6 +116,7 @@ \include{preprocessor} \include{lib-intro} \include{support} +\include{concepts} \include{diagnostics} \include{utilities} \include{strings} diff --git a/source/utilities.tex b/source/utilities.tex index e95e527617..eb8d6580da 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -13038,6 +13038,9 @@ template<> struct bit_xor; template<> struct bit_not; + // \ref{func.identity}, identity: + struct identity; + // \ref{func.not_fn}, function template \tcode{not_fn} template @\unspec@ not_fn(F&& f); @@ -14165,6 +14168,28 @@ \end{itemdescr} +\rSec2[func.identity]{Class \tcode{identity}} + +\indexlibrary{\idxcode{identity}}% +\begin{itemdecl} +struct identity { + template + constexpr T&& operator()(T&& t) const noexcept; + + using is_transparent = @\unspec@; +}; + +template + constexpr T&& operator()(T&& t) const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return std::forward(t);} +\end{itemdescr} + + \rSec2[func.not_fn]{Function template \tcode{not_fn}} \indexlibrary{\idxcode{not_fn}}% @@ -15527,31 +15552,36 @@ template struct enable_if; template struct conditional; template struct common_type; + template class TQual, template class UQual> + struct basic_common_reference { }; + template struct common_reference; template struct underlying_type; template struct invoke_result; template using type_identity_t = typename type_identity::type; template // see \ref{meta.trans.other} - using aligned_storage_t = typename aligned_storage::type; + using aligned_storage_t = typename aligned_storage::type; template - using aligned_union_t = typename aligned_union::type; + using aligned_union_t = typename aligned_union::type; template - using remove_cvref_t = typename remove_cvref::type; + using remove_cvref_t = typename remove_cvref::type; template - using decay_t = typename decay::type; + using decay_t = typename decay::type; template - using enable_if_t = typename enable_if::type; + using enable_if_t = typename enable_if::type; template - using conditional_t = typename conditional::type; + using conditional_t = typename conditional::type; + template + using common_type_t = typename common_type::type; template - using common_type_t = typename common_type::type; + using common_reference_t = typename common_reference::type; template - using underlying_type_t = typename underlying_type::type; + using underlying_type_t = typename underlying_type::type; template - using invoke_result_t = typename invoke_result::type; + using invoke_result_t = typename invoke_result::type; template - using void_t = void; + using void_t = void; // \ref{meta.logical}, logical operator traits template struct conjunction; @@ -16956,6 +16986,29 @@ Each type in the template parameter pack \tcode{T} shall be complete, \cv{}~\tcode{void}, or an array of unknown bound. \\ \rowsep +\indexlibrary{\idxcode{basic_common_reference}}% +\tcode{template class,} + \hspace*{2ex}\tcode{template class>} + \tcode{struct} + \hspace*{2ex}\tcode{basic_common_reference;} + & + A program may specialize this trait if at least one + template parameter in the specialization depends on a user-defined + type. If there is a member \tcode{type}, it shall be a + \grammarterm{typedef-name}. + \begin{note} + Such specializations can be used to influence the result of + \tcode{common_reference}. + \end{note} \\ \rowsep + +\indexlibrary{\idxcode{common_reference}}% +\tcode{template } \tcode{struct common_reference;} + & + The member \grammarterm{typedef-name} \tcode{type} is defined or omitted + as specified below. Each type in the parameter pack \tcode{T} shall be + complete or (possibly \cv) \tcode{void}. \\ \rowsep + \indexlibrary{\idxcode{underlying_type}}% \tcode{template}\br \tcode{struct underlying_type;} @@ -17007,6 +17060,54 @@ supported\iref{basic.align}. \indexlibrary{\idxcode{common_type}}% +\pnum +Let: +\begin{itemize} +\item \tcode{\placeholdernc{CREF}(A)} be + \tcode{add_lvalue_reference_t{}>}, +\item \tcode{\placeholdernc{XREF}(A)} denote a unary class template \tcode{T} + such that \tcode{T} denotes the same type as \tcode{U} with the addition + of \tcode{A}'s cv and reference qualifiers, for a type \tcode{U} such + that \tcode{is_same_v>} is \tcode{true}, +\item \tcode{\placeholdernc{COPYCV}(FROM, TO)} be an alias for type \tcode{TO} + with the addition of \tcode{FROM}'s top-level cv-qualifiers. + \begin{example} + \tcode{\placeholdernc{COPYCV}(const int, volatile short)} is an alias for + \tcode{const volatile short}. + \end{example} +\item \tcode{\placeholdernc{COND_RES}(X, Y)} be + \tcode{decltype(false ? declval()() : declval()())}. +\end{itemize} +Given types \tcode{A} and \tcode{B}, +let \tcode{X} be \tcode{remove_reference_t}, +let \tcode{Y} be \tcode{remove_reference_t}, and +let \tcode{\placeholdernc{COMMON_REF}(A, B)} be: +\begin{itemize} +\item If \tcode{A} and \tcode{B} are both lvalue reference types, + \tcode{\placeholdernc{COMMON_REF}(A, B)} is + \tcode{\placeholdernc{COND_RES}(\placeholdernc{COPYCV}(X, Y) \&, + \placeholdernc{COPYCV}(\brk{}Y, X) \&)} if that type exists + and is a reference type. +\item Otherwise, let \tcode{C} be + \tcode{remove_reference_t<\placeholdernc{COMMON_REF}(X\&, Y\&)>\&\&}. + If \tcode{A} and \tcode{B} are both rvalue reference types, + \tcode{C} is well-formed, and + \tcode{is_convertible_v \&\& is_convertible_v} is \tcode{true}, + then \tcode{\placeholdernc{COMMON_REF}(A, B)} is \tcode{C}. +\item Otherwise, let \tcode{D} be + \tcode{\placeholdernc{COMMON_REF}(const X\&, Y\&)}. If \tcode{A} is an rvalue + reference and \tcode{B} is an lvalue reference and \tcode{D} is + well-formed and \tcode{is_convertible_v} is + \tcode{true}, then \tcode{\placeholdernc{COMMON_REF}(A, B)} is \tcode{D}. +\item Otherwise, if \tcode{A} is an lvalue reference and \tcode{B} + is an rvalue reference, then \tcode{\placeholdernc{COMMON_REF}(A, B)} is + \tcode{\placeholdernc{COMMON_REF}(B, A)}. +\item Otherwise, \tcode{\placeholdernc{COMMON_REF}(A, B)} is ill-formed. +\end{itemize} + +If any of the types computed above is ill-formed, then +\tcode{\placeholdernc{COMMON_REF}(A, B)} is ill-formed. + \pnum Note A: For the \tcode{common_type} trait applied to a template parameter pack \tcode{T} of types, @@ -17029,14 +17130,24 @@ \begin{itemize} \item If \tcode{is_same_v} is \tcode{false} or \tcode{is_same_v} is \tcode{false}, - let \tcode{C} denote the same type, if any, as \tcode{common_type_t}. - \item Otherwise, let \tcode{C} denote the same type, if any, as + let \tcode{C} denote the same type, if any, + as \tcode{common_type_t}. + \item + \begin{note} + None of the following will apply if there is a specialization + \tcode{common_type}. + \end{note} + \item Otherwise, if \begin{codeblock} decay_t() : declval())> \end{codeblock} - \begin{note} - This will not apply if there is a specialization \tcode{common_type}. - \end{note} + denotes a valid type, let \tcode{C} denote that type. + \item Otherwise, if + \tcode{\placeholdernc{COND_RES}(\placeholdernc{CREF}(D1), + \placeholdernc{CREF}(D2))} + denotes a type, let \tcode{C} denote the type + \tcode{decay_t<\placeholdernc{COND_RES}(\placeholdernc{CREF}(D1), + \placeholdernc{CREF}(D2))>}. \end{itemize} In either case, the member \grammarterm{typedef-name} \tcode{type} shall denote the same type, if any, as \tcode{C}. @@ -17070,6 +17181,72 @@ the same type, if any, as does \tcode{common_type_t}. No diagnostic is required for a violation of this Note's rules. +\pnum +For the \tcode{common_reference} trait applied to a parameter pack \tcode{T} of +types, the member \tcode{type} shall be either defined or not present as +follows: +\begin{itemize} +\item If \tcode{sizeof...(T)} is zero, there shall be no member \tcode{type}. + +\item Otherwise, if \tcode{sizeof...(T)} is one, let \tcode{T0} denote the sole + type in the pack \tcode{T}. The member typedef \tcode{type} shall denote the + same type as \tcode{T0}. + +\item Otherwise, if \tcode{sizeof...(T)} is two, let \tcode{T1} and \tcode{T2} + denote the two types in the pack \tcode{T}. Then + \begin{itemize} + \item If \tcode{T1} and \tcode{T2} are reference types and + \tcode{\placeholdernc{COMMON_REF}(T1, T2)} is well-formed, then the member + typedef \tcode{type} denotes that type. + + \item Otherwise, if + \tcode{basic_common_reference, remove_cvref_t, + \brk{}\placeholdernc{XREF}(\brk{}T1), \placeholdernc{XREF}(T2)>::type} + is well-formed, then the member typedef \tcode{type} denotes that type. + + \item Otherwise, if \tcode{\placeholdernc{COND_RES}(T1, T2)} is well-formed, + then the member typedef \tcode{type} denotes that type. + + \item Otherwise, if \tcode{common_type_t} is well-formed, then the + member typedef \tcode{type} denotes that type. + + \item Otherwise, there shall be no member \tcode{type}. + \end{itemize} + +\item Otherwise, if \tcode{sizeof...(T)} is greater than two, let \tcode{T1}, + \tcode{T2}, and \tcode{Rest}, respectively, denote the first, second, and + (pack of) remaining types comprising \tcode{T}. Let \tcode{C} be the type + \tcode{common_reference_t}. Then: + \begin{itemize} + \item If there is such a type \tcode{C}, the member typedef \tcode{type} shall + denote the same type, if any, as \tcode{common_reference_t}. + + \item Otherwise, there shall be no member \tcode{type}. + \end{itemize} +\end{itemize} + +\pnum +Notwithstanding the provisions of \ref{meta.type.synop}, and +pursuant to \ref{namespace.std}, a program may specialize +\tcode{basic_common_reference} +for types \tcode{T} and \tcode{U} such that +\tcode{is_same_v{>}} and +\tcode{is_same_v{>}} are each \tcode{true}. +\begin{note} +Such specializations are needed when only explicit conversions are desired +between the template arguments. +\end{note} +Such a specialization need not have a member named \tcode{type}, but if it does, +that member shall be a \grammarterm{typedef-name} for an accessible and +unambiguous type \tcode{C} to which each of the types \tcode{TQual} and +\tcode{UQual} is convertible. +Moreover, \tcode{basic_common_reference::type} shall denote +the same type, if any, as does +\tcode{basic_common_reference::type}. +A program shall not specialize \tcode{basic_common_reference} on the third or +fourth parameters, \tcode{TQual} or \tcode{UQual}. No diagnostic is required for +a violation of these rules. + \pnum \begin{example} Given these definitions: From af4a3f266052b630f05f6b1f761844779d900ebd Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 09:02:09 -0700 Subject: [PATCH 12/33] [concepts.lib.general.equality] Replace "this specification" with "this document" --- source/concepts.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/concepts.tex b/source/concepts.tex index 3382740aef..548d19cfec 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -37,7 +37,7 @@ input values for which the expression is required to be well-defined. \pnum -Expressions required by this specification to be equality preserving are further +Expressions required by this document to be equality-preserving are further required to be stable: two evaluations of such an expression with the same input objects must have equal outputs absent any explicit intervening modification of those input objects. From e800697d814ea7ca6fb6e8283f9d3906b0ab9d40 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 09:14:01 -0700 Subject: [PATCH 13/33] [concepts.lib.general.equality] Hyphenate equality-preserving --- source/concepts.tex | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 548d19cfec..7f49c0bd22 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -24,7 +24,7 @@ \rSec2[concepts.lib.general.equality]{Equality Preservation} \pnum -An expression is \defnx{equality preserving}{expression!equality preserving} if, +An expression is \defnx{equality-preserving}{expression!equality-preserving} if, given equal inputs, the expression results in equal outputs. The inputs to an expression are the set of the expression's operands. The output of an expression is the expression's result and all operands modified by the expression. @@ -33,7 +33,7 @@ Not all input values must be valid for a given expression; e.g., for integers \tcode{a} and \tcode{b}, the expression \tcode{a / b} is not well-defined when \tcode{b} is \tcode{0}. This does not preclude the expression \tcode{a / b} -being equality preserving. The \term{domain} of an expression is the set of +being equality-preserving. The \term{domain} of an expression is the set of input values for which the expression is required to be well-defined. \pnum @@ -43,24 +43,24 @@ those input objects. \begin{note} This requirement allows generic code to reason about the current values of -objects based on knowledge of the prior values as observed via equality -preserving expressions. It effectively forbids spontaneous changes to an object, -changes to an object from another thread of execution, changes to an object as -side effects of non-modifying expressions, and changes to an object as side -effects of modifying a distinct object if those changes could be observable to a -library function via an equality preserving expression that is required to be -valid for that object. +objects based on knowledge of the prior values as observed via +equality-preserving expressions. It effectively forbids spontaneous changes to +an object, changes to an object from another thread of execution, changes to an +object as side effects of non-modifying expressions, and changes to an object as +side effects of modifying a distinct object if those changes could be observable +to a library function via an equality-preserving expression that is required to +be valid for that object. \end{note} \pnum Expressions declared in a \grammarterm{requires-expression} in this document are -required to be equality preserving, except for those annotated with the comment -``not required to be equality preserving.'' An expression so annotated -may be equality preserving, but is not required to be so. +required to be equality-preserving, except for those annotated with the comment +``not required to be equality-preserving.'' An expression so annotated +may be equality-preserving, but is not required to be so. \pnum An expression that may alter the value of one or more of its inputs in a manner -observable to equality preserving expressions is said to modify those inputs. +observable to equality-preserving expressions is said to modify those inputs. This document uses a notational convention to specify which expressions declared in a \grammarterm{requires-expression} modify which inputs: except where otherwise specified, an expression operand that is a non-constant lvalue or @@ -359,7 +359,7 @@ } \end{codeblock} and let \tcode{f} be a function with no arguments and return type \tcode{From} -such that \tcode{f()} is equality preserving. +such that \tcode{f()} is equality-preserving. \tcode{\libconcept{ConvertibleTo}} is satisfied only if: \begin{itemize} @@ -423,9 +423,9 @@ satisfied only if: \begin{itemize} \item \tcode{C(t())} equals \tcode{C(t())} if and only if \tcode{t()} is an - equality preserving expression\iref{concepts.lib.general.equality}. + equality-preserving expression\iref{concepts.lib.general.equality}. \item \tcode{C(u())} equals \tcode{C(u())} if and only if \tcode{u()} is an - equality preserving expression. + equality-preserving expression. \end{itemize} \pnum @@ -471,10 +471,10 @@ satisfied only if: \begin{itemize} \item \tcode{C(t())} equals \tcode{C(t())} if and only if - \tcode{t()} is an equality preserving + \tcode{t()} is an equality-preserving expression\iref{concepts.lib.general.equality}. \item \tcode{C(u())} equals \tcode{C(u())} if and only if - \tcode{u()} is an equality preserving + \tcode{u()} is an equality-preserving expression\iref{concepts.lib.general.equality}. \end{itemize} @@ -962,7 +962,7 @@ \pnum \begin{note} -The requirement that the expression \tcode{a == b} is equality preserving +The requirement that the expression \tcode{a == b} is equality-preserving implies that \tcode{==} is reflexive, transitive, and symmetric. \end{note} \end{itemdescr} @@ -1153,7 +1153,7 @@ \begin{itemdecl} template concept Invocable = requires(F&& f, Args&&... args) { - invoke(std::forward(f), std::forward(args)...); // not required to be equality preserving + invoke(std::forward(f), std::forward(args)...); // not required to be equality-preserving }; \end{itemdecl} From 19d2ed00f8fe4d4fdd2efc81316068ab1f21d59e Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 11:50:58 -0700 Subject: [PATCH 14/33] [concepts] Shorten stable names: * Remove ".lib" * Replace "concepts." with "concept." in the stable names of the subclauses that define specific concepts, and remove the "collection" tags (".corelang", ".object", ".compare", ".callable") so e.g. [concepts.lib.corelang.same] becomes [concept.same] * Replace ".corelang" with ".lang" * Rename [concepts.lib.synopsis] to [concepts.syn] * Rename [concepts.lib.corelang.signedintegral] to [concepts.signed.int] * Rename [concepts.lib.corelang.unsignedintegral] to [concepts.unsigned.int] --- source/concepts.tex | 162 +++++++++++++++++++++---------------------- source/lib-intro.tex | 12 ++-- 2 files changed, 87 insertions(+), 87 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 7f49c0bd22..a328c04bf5 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -1,7 +1,7 @@ %!TEX root = std.tex -\rSec0[concepts.lib]{Concepts library} +\rSec0[concepts]{Concepts library} -\rSec1[concepts.lib.general]{General} +\rSec1[concepts.general]{General} \pnum This Clause describes library components that \Cpp{} programs may use to perform @@ -15,13 +15,13 @@ \tref{concepts.lib.summary}. \begin{libsumtab}{Fundamental concepts library summary}{tab:concepts.lib.summary} -\ref{concepts.lib.corelang} & Core language concepts & \tcode{} \\ -\ref{concepts.lib.compare} & Comparison concepts & \\ -\ref{concepts.lib.object} & Object concepts & \\ -\ref{concepts.lib.callable} & Callable concepts & \\ +\ref{concepts.lang} & Core language concepts & \tcode{} \\ +\ref{concepts.compare} & Comparison concepts & \\ +\ref{concepts.object} & Object concepts & \\ +\ref{concepts.callable} & Callable concepts & \\ \end{libsumtab} -\rSec2[concepts.lib.general.equality]{Equality Preservation} +\rSec2[concepts.general.equality]{Equality Preservation} \pnum An expression is \defnx{equality-preserving}{expression!equality-preserving} if, @@ -130,137 +130,137 @@ as ill-formed a program which requires \tcode{C}. \end{example} -\rSec1[concepts.lib.synopsis]{Header \tcode{} synopsis} +\rSec1[concepts.syn]{Header \tcode{} synopsis} \indexlibrary{\idxhdr{concepts}}% \begin{codeblock} namespace std { - // \ref{concepts.lib.corelang}, core language concepts: - // \ref{concepts.lib.corelang.same}, Same: + // \ref{concepts.lang}, core language concepts: + // \ref{concept.same}, Same: template concept Same = @\seebelow@; - // \ref{concepts.lib.corelang.derived}, DerivedFrom: + // \ref{concept.derivedfrom}, DerivedFrom: template concept DerivedFrom = @\seebelow@; - // \ref{concepts.lib.corelang.convertibleto}, ConvertibleTo: + // \ref{concept.convertibleto}, ConvertibleTo: template concept ConvertibleTo = @\seebelow@; - // \ref{concepts.lib.corelang.commonref}, CommonReference: + // \ref{concept.commonref}, CommonReference: template concept CommonReference = @\seebelow@; - // \ref{concepts.lib.corelang.common}, Common: + // \ref{concept.common}, Common: template concept Common = @\seebelow@; - // \ref{concepts.lib.corelang.integral}, Integral: + // \ref{concept.integral}, Integral: template concept Integral = @\seebelow@; - // \ref{concepts.lib.corelang.signedintegral}, SignedIntegral: + // \ref{concept.signed.int}, SignedIntegral: template concept SignedIntegral = @\seebelow@; - // \ref{concepts.lib.corelang.unsignedintegral}, UnsignedIntegral: + // \ref{concept.unsigned.int}, UnsignedIntegral: template concept UnsignedIntegral = @\seebelow@; - // \ref{concepts.lib.corelang.assignable}, Assignable: + // \ref{concept.assignable}, Assignable: template concept Assignable = @\seebelow@; - // \ref{concepts.lib.corelang.swappable}, Swappable: + // \ref{concept.swappable}, Swappable: template concept Swappable = @\seebelow@; template concept SwappableWith = @\seebelow@; - // \ref{concepts.lib.corelang.destructible}, Destructible: + // \ref{concept.destructible}, Destructible: template concept Destructible = @\seebelow@; - // \ref{concepts.lib.corelang.constructible}, Constructible: + // \ref{concept.constructible}, Constructible: template concept Constructible = @\seebelow@; - // \ref{concepts.lib.corelang.defaultconstructible}, DefaultConstructible: + // \ref{concept.defaultconstructible}, DefaultConstructible: template concept DefaultConstructible = @\seebelow@; - // \ref{concepts.lib.corelang.moveconstructible}, MoveConstructible: + // \ref{concept.moveconstructible}, MoveConstructible: template concept MoveConstructible = @\seebelow@; - // \ref{concepts.lib.corelang.copyconstructible}, CopyConstructible: + // \ref{concept.copyconstructible}, CopyConstructible: template concept CopyConstructible = @\seebelow@; - // \ref{concepts.lib.compare}, comparison concepts: - // \ref{concepts.lib.compare.boolean}, Boolean: + // \ref{concepts.compare}, comparison concepts: + // \ref{concept.boolean}, Boolean: template concept Boolean = @\seebelow@; - // \ref{concepts.lib.compare.equalitycomparable}, EqualityComparable: + // \ref{concept.equalitycomparable}, EqualityComparable: template concept EqualityComparable = @\seebelow@; template concept EqualityComparableWith = @\seebelow@; - // \ref{concepts.lib.compare.stricttotallyordered}, StrictTotallyOrdered: + // \ref{concept.stricttotallyordered}, StrictTotallyOrdered: template concept StrictTotallyOrdered = @\seebelow@; template concept StrictTotallyOrderedWith = @\seebelow@; - // \ref{concepts.lib.object}, object concepts: - // \ref{concepts.lib.object.movable}, Movable: + // \ref{concepts.object}, object concepts: + // \ref{concept.movable}, Movable: template concept Movable = @\seebelow@; - // \ref{concepts.lib.object.copyable}, Copyable: + // \ref{concept.copyable}, Copyable: template concept Copyable = @\seebelow@; - // \ref{concepts.lib.object.semiregular}, Semiregular: + // \ref{concept.semiregular}, Semiregular: template concept Semiregular = @\seebelow@; - // \ref{concepts.lib.object.regular}, Regular: + // \ref{concept.regular}, Regular: template concept Regular = @\seebelow@; - // \ref{concepts.lib.callable}, callable concepts: - // \ref{concepts.lib.callable.invocable}, Invocable: + // \ref{concepts.callable}, callable concepts: + // \ref{concept.invocable}, Invocable: template concept Invocable = @\seebelow@; - // \ref{concepts.lib.callable.regularinvocable}, RegularInvocable: + // \ref{concept.regularinvocable}, RegularInvocable: template concept RegularInvocable = @\seebelow@; - // \ref{concepts.lib.callable.predicate}, Predicate: + // \ref{concept.predicate}, Predicate: template concept Predicate = @\seebelow@; - // \ref{concepts.lib.callable.relation}, Relation: + // \ref{concept.relation}, Relation: template concept Relation = @\seebelow@; - // \ref{concepts.lib.callable.strictweakorder}, StrictWeakOrder: + // \ref{concept.strictweakorder}, StrictWeakOrder: template concept StrictWeakOrder = @\seebelow@; } \end{codeblock} -\rSec1[concepts.lib.corelang]{Core language concepts} +\rSec1[concepts.lang]{Core language concepts} -\rSec2[concepts.lib.corelang.general]{General} +\rSec2[concepts.lang.general]{General} \pnum This section contains the definition of concepts corresponding to language @@ -289,7 +289,7 @@ subsumption relationship between \tcode{C1} and \tcode{is_c1_v}. \end{example} -\rSec2[concepts.lib.corelang.same]{Concept \libconcept{Same}} +\rSec2[concept.same]{Concept \libconcept{Same}} \indexlibrary{\idxcode{Same}}% \begin{itemdecl} @@ -309,7 +309,7 @@ vice versa. \end{itemdescr} -\rSec2[concepts.lib.corelang.derived]{Concept \libconcept{DerivedFrom}} +\rSec2[concept.derivedfrom]{Concept \libconcept{DerivedFrom}} \indexlibrary{\idxcode{DerivedFrom}}% \begin{itemdecl} @@ -336,7 +336,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.convertibleto]{Concept \libconcept{ConvertibleTo}} +\rSec2[concept.convertibleto]{Concept \libconcept{ConvertibleTo}} \pnum The \libconcept{ConvertibleTo} concept requires an expression of a particular @@ -391,7 +391,7 @@ \end{itemdescr} -\rSec2[concepts.lib.corelang.commonref]{Concept \libconcept{CommonReference}} +\rSec2[concept.commonref]{Concept \libconcept{CommonReference}} \pnum For two types \tcode{T} and \tcode{U}, if \tcode{common_reference_t} @@ -423,7 +423,7 @@ satisfied only if: \begin{itemize} \item \tcode{C(t())} equals \tcode{C(t())} if and only if \tcode{t()} is an - equality-preserving expression\iref{concepts.lib.general.equality}. + equality-preserving expression\iref{concepts.general.equality}. \item \tcode{C(u())} equals \tcode{C(u())} if and only if \tcode{u()} is an equality-preserving expression. \end{itemize} @@ -435,7 +435,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.common]{Concept \libconcept{Common}} +\rSec2[concept.common]{Concept \libconcept{Common}} \pnum If \tcode{T} and \tcode{U} can both be explicitly converted to some third type, @@ -472,10 +472,10 @@ \begin{itemize} \item \tcode{C(t())} equals \tcode{C(t())} if and only if \tcode{t()} is an equality-preserving - expression\iref{concepts.lib.general.equality}. + expression\iref{concepts.general.equality}. \item \tcode{C(u())} equals \tcode{C(u())} if and only if \tcode{u()} is an equality-preserving - expression\iref{concepts.lib.general.equality}. + expression\iref{concepts.general.equality}. \end{itemize} \pnum @@ -486,7 +486,7 @@ \end{itemdescr} -\rSec2[concepts.lib.corelang.integral]{Concept \libconcept{Integral}} +\rSec2[concept.integral]{Concept \libconcept{Integral}} \indexlibrary{\idxcode{Integral}}% \begin{itemdecl} @@ -502,7 +502,7 @@ \tcode{is_integral_v}. \end{itemdescr} -\rSec2[concepts.lib.corelang.signedintegral]{Concept \libconcept{SignedIntegral}} +\rSec2[concept.signed.int]{Concept \libconcept{SignedIntegral}} \indexlibrary{\idxcode{SignedIntegral}}% \begin{itemdecl} @@ -524,7 +524,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.unsignedintegral]{Concept \libconcept{UnsignedIntegral}} +\rSec2[concept.unsigned.int]{Concept \libconcept{UnsignedIntegral}} \indexlibrary{\idxcode{UnsignedIntegral}}% \begin{itemdecl} @@ -540,7 +540,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.assignable]{Concept \libconcept{Assignable}} +\rSec2[concept.assignable]{Concept \libconcept{Assignable}} \indexlibrary{\idxcode{Assignable}}% \begin{itemdecl} @@ -598,7 +598,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.swappable]{Concept \libconcept{Swappable}} +\rSec2[concept.swappable]{Concept \libconcept{Swappable}} \indexlibrary{\idxcode{Swappable}}% \begin{itemdecl} @@ -745,7 +745,7 @@ \end{example} \end{itemdescr} -\rSec2[concepts.lib.corelang.destructible]{Concept \libconcept{Destructible}} +\rSec2[concept.destructible]{Concept \libconcept{Destructible}} \pnum The \libconcept{Destructible} concept specifies properties of all types, @@ -772,7 +772,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.corelang.constructible]{Concept \libconcept{Constructible}} +\rSec2[concept.constructible]{Concept \libconcept{Constructible}} \pnum The \libconcept{Constructible} concept constrains the initialization of a @@ -792,7 +792,7 @@ \tcode{is_const\-ruct\-ible_v}. \end{itemdescr} -\rSec2[concepts.lib.corelang.defaultconstructible]{Concept \libconcept{DefaultConstructible}} +\rSec2[concept.defaultconstructible]{Concept \libconcept{DefaultConstructible}} \indexlibrary{\idxcode{DefaultConstructible}}% \begin{itemdecl} @@ -800,7 +800,7 @@ concept DefaultConstructible = Constructible; \end{itemdecl} -\rSec2[concepts.lib.corelang.moveconstructible]{Concept \libconcept{MoveConstructible}} +\rSec2[concept.moveconstructible]{Concept \libconcept{MoveConstructible}} \indexlibrary{\idxcode{MoveConstructible}}% \begin{itemdecl} @@ -824,7 +824,7 @@ \end{itemize} \end{itemdescr} -\rSec2[concepts.lib.corelang.copyconstructible]{Concept \libconcept{CopyConstructible}} +\rSec2[concept.copyconstructible]{Concept \libconcept{CopyConstructible}} \indexlibrary{\idxcode{CopyConstructible}}% \begin{itemdecl} @@ -849,15 +849,15 @@ \end{itemdescr} -\rSec1[concepts.lib.compare]{Comparison concepts} +\rSec1[concepts.compare]{Comparison concepts} -\rSec2[concepts.lib.compare.general]{General} +\rSec2[concepts.compare.general]{General} \pnum This section describes concepts that establish relationships and orderings on values of possibly differing object types. -\rSec2[concepts.lib.compare.boolean]{Concept \libconcept{Boolean}} +\rSec2[concept.boolean]{Concept \libconcept{Boolean}} \pnum The \libconcept{Boolean} concept specifies the requirements on a type that is @@ -866,7 +866,7 @@ \indexlibrary{\idxcode{Boolean}}% \begin{itemdecl} template -concept Boolean = Movable> && // (see \ref{concepts.lib.object.movable}) +concept Boolean = Movable> && // (see \ref{concept.movable}) requires(const remove_reference_t& b1, const remove_reference_t& b2, const bool a) { requires ConvertibleTo&, bool>; @@ -917,7 +917,7 @@ \tcode{bool} are not \libconcept{Boolean} types. \end{example} -\rSec2[concepts.lib.compare.equalitycomparable]{Concept \libconcept{EqualityComparable}} +\rSec2[concept.equalitycomparable]{Concept \libconcept{EqualityComparable}} \begin{itemdecl} template @@ -958,7 +958,7 @@ Let \tcode{a} and \tcode{b} be objects of type \tcode{T}. \tcode{\libconcept{EqualityComparable}} is satisfied only if \tcode{bool(a == b)} is \tcode{true} when \tcode{a} is equal to -\tcode{b}\iref{concepts.lib.general.equality}, and \tcode{false} otherwise. +\tcode{b}\iref{concepts.general.equality}, and \tcode{false} otherwise. \pnum \begin{note} @@ -992,7 +992,7 @@ \tcode{bool(t == u) == bool(C(t) == C(u))}. \end{itemdescr} -\rSec2[concepts.lib.compare.stricttotallyordered]{Concept \libconcept{StrictTotallyOrdered}} +\rSec2[concept.stricttotallyordered]{Concept \libconcept{StrictTotallyOrdered}} \indexlibrary{\idxcode{StrictTotallyOrdered}}% \begin{itemdecl} @@ -1069,14 +1069,14 @@ \end{itemize} \end{itemdescr} -\rSec1[concepts.lib.object]{Object concepts} +\rSec1[concepts.object]{Object concepts} -\rSec2[concepts.lib.object.general]{General} +\rSec2[concepts.object.general]{General} \pnum This section describes concepts that specify the basis of the value-oriented programming style on which the library is based. -\rSec2[concepts.lib.object.movable]{Concept \libconcept{Movable}} +\rSec2[concept.movable]{Concept \libconcept{Movable}} \indexlibrary{\idxcode{Movable}}% \begin{itemdecl} @@ -1092,7 +1092,7 @@ \tcode{is_object_v}. \end{itemdescr} -\rSec2[concepts.lib.object.copyable]{Concept \libconcept{Copyable}} +\rSec2[concept.copyable]{Concept \libconcept{Copyable}} \indexlibrary{\idxcode{Copyable}}% \begin{itemdecl} @@ -1100,7 +1100,7 @@ concept Copyable = CopyConstructible && Movable && Assignable; \end{itemdecl} -\rSec2[concepts.lib.object.semiregular]{Concept \libconcept{Semiregular}} +\rSec2[concept.semiregular]{Concept \libconcept{Semiregular}} \indexlibrary{\idxcode{Semiregular}}% \begin{itemdecl} @@ -1117,7 +1117,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.object.regular]{Concept \libconcept{Regular}} +\rSec2[concept.regular]{Concept \libconcept{Regular}} \indexlibrary{\idxcode{Regular}}% \begin{itemdecl} @@ -1134,15 +1134,15 @@ \end{note} \end{itemdescr} -\rSec1[concepts.lib.callable]{Callable concepts} +\rSec1[concepts.callable]{Callable concepts} -\rSec2[concepts.lib.callable.general]{General} +\rSec2[concepts.callable.general]{General} \pnum The concepts in this section describe the requirements on function objects\iref{function.objects} and their arguments. -\rSec2[concepts.lib.callable.invocable]{Concept \libconcept{Invocable}} +\rSec2[concept.invocable]{Concept \libconcept{Invocable}} \pnum The \libconcept{Invocable} concept specifies a relationship between a callable @@ -1162,11 +1162,11 @@ \begin{example} A function that generates random numbers can satisfy \libconcept{Invocable}, since the \tcode{invoke} function call expression is not required to be -equality-preserving\iref{concepts.lib.general.equality}. +equality-preserving\iref{concepts.general.equality}. \end{example} \end{itemdescr} -\rSec2[concepts.lib.callable.regularinvocable]{Concept \libconcept{RegularInvocable}} +\rSec2[concept.regularinvocable]{Concept \libconcept{RegularInvocable}} \indexlibrary{\idxcode{RegularInvocable}}% \begin{itemdecl} @@ -1178,7 +1178,7 @@ \pnum The \tcode{invoke} function call expression shall be equality-preserving and shall not modify the function object or the -arguments\iref{concepts.lib.general.equality}. +arguments\iref{concepts.general.equality}. \begin{note} This requirement supersedes the annotation in the definition of \libconcept{Invocable}. @@ -1197,7 +1197,7 @@ \end{note} \end{itemdescr} -\rSec2[concepts.lib.callable.predicate]{Concept \libconcept{Predicate}} +\rSec2[concept.predicate]{Concept \libconcept{Predicate}} \indexlibrary{\idxcode{Predicate}}% \begin{itemdecl} @@ -1206,7 +1206,7 @@ Boolean>; \end{itemdecl} -\rSec2[concepts.lib.callable.relation]{Concept \libconcept{Relation}} +\rSec2[concept.relation]{Concept \libconcept{Relation}} \indexlibrary{\idxcode{Relation}}% \begin{itemdecl} @@ -1241,7 +1241,7 @@ \end{itemize} \end{itemdescr} -\rSec2[concepts.lib.callable.strictweakorder]{Concept \libconcept{StrictWeakOrder}} +\rSec2[concept.strictweakorder]{Concept \libconcept{StrictWeakOrder}} \indexlibrary{\idxcode{Relation}}% \begin{itemdecl} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 4bb2c8ab96..6796d58621 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -24,7 +24,7 @@ \begin{libsumtabbase}{Library categories}{tab:library.categories}{Clause}{Category} \ref{language.support} & & Language support library \\ -\ref{concepts.lib} & & Concepts library \\ +\ref{concepts} & & Concepts library \\ \ref{diagnostics} & & Diagnostics library \\ \ref{utilities} & & General utilities library \\ \ref{strings} & & Strings library \\ @@ -45,7 +45,7 @@ \ref{expr.delete}) and exception processing\iref{except}. \pnum -The concepts library\iref{concepts.lib} describes library components that \Cpp{} +The concepts library\iref{concepts} describes library components that \Cpp{} programs may use to perform compile-time validation of template parameters and perform function dispatch based on properties of types. @@ -492,7 +492,7 @@ result in the required semantics failing to be satisfied. \begin{example} The required \tcode{<} operator of the \libconcept{StrictTotallyOrdered} -concept\iref{concepts.lib.compare.stricttotallyordered} does not meet the +concept\iref{concept.stricttotallyordered} does not meet the semantic requirements of that concept when operating on NaNs. \end{example} This does not affect whether a type satisfies the concept. @@ -940,15 +940,15 @@ \pnum The type of a customization point object shall satisfy -\libconcept{Semiregular}\iref{concepts.lib.object.semiregular}. +\libconcept{Semiregular}\iref{concept.semiregular}. \pnum All instances of a specific customization point object type shall -be equal\iref{concepts.lib.general.equality}. +be equal\iref{concepts.general.equality}. \pnum The type \tcode{T} of a customization point object shall satisfy -\tcode{\libconcept{Invocable}}\iref{concepts.lib.callable.invocable} +\tcode{\libconcept{Invocable}}\iref{concept.invocable} when the types in \tcode{Args...} meet the requirements specified in that customization point object's definition. When the types of \tcode{Args...} do not meet the customization point object's requirements, \tcode{T} shall not have From e9c46ddeffde70c2b1fd298391af2f6450203641 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 09:29:42 -0700 Subject: [PATCH 15/33] [concepts.lang] Retitle as "Language-related concepts" --- source/concepts.tex | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index a328c04bf5..a7e9ba3bbf 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -10,15 +10,15 @@ a foundation for equational reasoning in programs. \pnum -The following subclauses describe core language concepts, comparison concepts, -object concepts, and callable concepts as summarized in +The following subclauses describe language-related concepts, comparison +concepts, object concepts, and callable concepts as summarized in \tref{concepts.lib.summary}. \begin{libsumtab}{Fundamental concepts library summary}{tab:concepts.lib.summary} -\ref{concepts.lang} & Core language concepts & \tcode{} \\ -\ref{concepts.compare} & Comparison concepts & \\ -\ref{concepts.object} & Object concepts & \\ -\ref{concepts.callable} & Callable concepts & \\ +\ref{concepts.lang} & Language-related concepts & \tcode{} \\ +\ref{concepts.compare} & Comparison concepts & \\ +\ref{concepts.object} & Object concepts & \\ +\ref{concepts.callable} & Callable concepts & \\ \end{libsumtab} \rSec2[concepts.general.equality]{Equality Preservation} @@ -135,7 +135,7 @@ \indexlibrary{\idxhdr{concepts}}% \begin{codeblock} namespace std { - // \ref{concepts.lang}, core language concepts: + // \ref{concepts.lang}, language-related concepts: // \ref{concept.same}, Same: template concept Same = @\seebelow@; @@ -258,7 +258,7 @@ } \end{codeblock} -\rSec1[concepts.lang]{Core language concepts} +\rSec1[concepts.lang]{Language-related concepts} \rSec2[concepts.lang.general]{General} From 31682fb92ff48b484223be0439345184f3ea681f Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 08:37:49 -0700 Subject: [PATCH 16/33] [support.limits.general] Add feature test macro __cpp_lib_concepts for P0898R3 --- source/support.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/support.tex b/source/support.tex index b727f39678..f7e7fde275 100644 --- a/source/support.tex +++ b/source/support.tex @@ -563,6 +563,8 @@ \tcode{} \\ \rowsep \defnlibxname{cpp_lib_complex_udls} & \tcode{201309L} & \tcode{} \\ \rowsep +\defnlibxname{cpp_lib_concepts} & \tcode{201806L} & + \tcode{} \\ \rowsep \defnlibxname{cpp_lib_enable_shared_from_this} & \tcode{201603L} & \tcode{} \\ \rowsep \defnlibxname{cpp_lib_exchange_function} & \tcode{201304L} & From 9ad9c1359ed135e13b2e99588c95aada057552a8 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 09:18:24 -0700 Subject: [PATCH 17/33] [concepts] Rephrase ocurrences of "must" --- source/concepts.tex | 19 ++++++++++--------- source/lib-intro.tex | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index a7e9ba3bbf..ffdfa675c1 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -30,7 +30,7 @@ is the expression's result and all operands modified by the expression. \pnum -Not all input values must be valid for a given expression; e.g., for integers +Not all input values need be valid for a given expression; e.g., for integers \tcode{a} and \tcode{b}, the expression \tcode{a / b} is not well-defined when \tcode{b} is \tcode{0}. This does not preclude the expression \tcode{a / b} being equality-preserving. The \term{domain} of an expression is the set of @@ -39,8 +39,8 @@ \pnum Expressions required by this document to be equality-preserving are further required to be stable: two evaluations of such an expression with the same input -objects must have equal outputs absent any explicit intervening modification of -those input objects. +objects are required to have equal outputs absent any explicit intervening +modification of those input objects. \begin{note} This requirement allows generic code to reason about the current values of objects based on knowledge of the prior values as observed via @@ -64,8 +64,8 @@ This document uses a notational convention to specify which expressions declared in a \grammarterm{requires-expression} modify which inputs: except where otherwise specified, an expression operand that is a non-constant lvalue or -rvalue may be modified. Operands that are constant lvalues or rvalues must not -be modified. +rvalue may be modified. Operands that are constant lvalues or rvalues are +required to not be modified. \pnum Where a \grammarterm{requires-expression} declares an expression that is @@ -73,9 +73,9 @@ expression that accept a non-constant lvalue or (possibly constant) rvalue for the given operand are also required except where such an expression variation is explicitly required with differing semantics. These -\term{implicit expression variations} must meet the semantic requirements of the -declared expression. The extent to which an implementation validates the syntax -of the variations is unspecified. +\term{implicit expression variations} are required to meet the semantic +requirements of the declared expression. The extent to which an implementation +validates the syntax of the variations is unspecified. \begin{example} \begin{codeblock} @@ -341,7 +341,8 @@ \pnum The \libconcept{ConvertibleTo} concept requires an expression of a particular type and value category to be both implicitly and explicitly convertible to some -other type. The implicit and explicit conversions must produce equal results. +other type. The implicit and explicit conversions are required to produce equal +results. \indexlibrary{\idxcode{ConvertibleTo}}% \begin{itemdecl} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 6796d58621..b831563493 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -967,7 +967,7 @@ the same name in namespace \tcode{std}, customization point objects specify that lookup for these expressions is performed in a context that includes deleted overloads matching the signatures of overloads defined in namespace \tcode{std}. -When the deleted overloads are viable, user-defined overloads must be more +When the deleted overloads are viable, user-defined overloads need be more specialized\iref{temp.func.order} or more constrained\iref{temp.constr.order} to be used by a customization point object. \end{note} From d8db67fa5c90396d4c46a8b6af94534b6fd9ebcc Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 15:16:51 -0700 Subject: [PATCH 18/33] [definitions] redefine expression-equivalent per ISO directives To be replaceable in context, and add a clarifying example. --- source/lib-intro.tex | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index b831563493..ed746001a9 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -227,16 +227,21 @@ \definition{expression-equivalent}{defns.expression-equivalent} \indexdefn{expression-equivalent}% -relationship that exists between two expressions \tcode{E1} and \tcode{E2} such -that -\begin{itemize} -\item \tcode{E1} and \tcode{E2} have the same effects, - -\item \tcode{noexcept(E1) == noexcept(E2)}, and +expressions which have the same effects, +all either are potentially-throwing\iref{except.spec} or not, +and +all either are constant subexpressions or not -\item \tcode{E1} is a constant subexpression if and only if \tcode{E2} is a -constant subexpression -\end{itemize} +\begin{example} +For a value \tcode{x} of type \tcode{int} +and a function \tcode{f} that accepts integer arguments, +the expressions +\tcode{f(x + 2)}, +\tcode{f(2 + x)}, +and +\tcode{f(1 + x + 1)} +are expression-equivalent. +\end{example} \definition{handler function}{defns.handler} \indexdefn{function!handler}% From d3c70aad615b0e72853ac11340b6e60d3bc34703 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 19 Jun 2018 15:34:43 -0700 Subject: [PATCH 19/33] [customization.point.object][meta.trans.other] Replace "user-defined" added by P0898R3 with "program-defined" ...to be consistent with the intent of LWG2139 --- source/lib-intro.tex | 23 ++++++++++++----------- source/utilities.tex | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index ed746001a9..ba50a8e215 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -940,8 +940,8 @@ \pnum A \term{customization point object} is a function object\iref{function.objects} -with a literal class type that interacts with user-defined types while enforcing -semantic requirements on that interaction. +with a literal class type that interacts with program-defined types while +enforcing semantic requirements on that interaction. \pnum The type of a customization point object shall satisfy @@ -966,15 +966,16 @@ \pnum \begin{note} Many of the customization point objects in the library evaluate function call -expressions with an unqualified name which results in a call to a user-defined -function found by argument dependent name lookup\iref{basic.lookup.argdep}. To -preclude such an expression resulting in a call to unconstrained functions with -the same name in namespace \tcode{std}, customization point objects specify that -lookup for these expressions is performed in a context that includes deleted -overloads matching the signatures of overloads defined in namespace \tcode{std}. -When the deleted overloads are viable, user-defined overloads need be more -specialized\iref{temp.func.order} or more constrained\iref{temp.constr.order} to -be used by a customization point object. +expressions with an unqualified name which results in a call to a +program-defined function found by argument dependent name +lookup\iref{basic.lookup.argdep}. To preclude such an expression resulting in a +call to unconstrained functions with the same name in namespace \tcode{std}, +customization point objects specify that lookup for these expressions is +performed in a context that includes deleted overloads matching the signatures +of overloads defined in namespace \tcode{std}. When the deleted overloads are +viable, program-defined overloads need be more specialized\iref{temp.func.order} +or more constrained\iref{temp.constr.order} to be used by a customization point +object. \end{note} \rSec3[functions.within.classes]{Functions within classes} diff --git a/source/utilities.tex b/source/utilities.tex index eb8d6580da..cc36e0d865 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16994,7 +16994,7 @@ \hspace*{2ex}\tcode{basic_common_reference;} & A program may specialize this trait if at least one - template parameter in the specialization depends on a user-defined + template parameter in the specialization depends on a program-defined type. If there is a member \tcode{type}, it shall be a \grammarterm{typedef-name}. \begin{note} From 245a8e3a79224246fa0d0e540aeb4eece6a8b242 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 09:38:44 -0700 Subject: [PATCH 20/33] [concepts.swappable] Correct example --- source/concepts.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index ffdfa675c1..5980cc50a9 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -706,16 +706,18 @@ User code can ensure that the evaluation of \tcode{swap} calls is performed in an appropriate context under the various conditions as follows: \begin{codeblock} +#include +#include #include -template U> +template U> void value_swap(T&& t, U&& u) { using std::swap; swap(std::forward(t), std::forward(u)); // OK: uses ``swappable with'' conditions // for rvalues and lvalues } -template +template void lv_swap(T& t1, T& t2) { using std::swap; swap(t1, t2); // OK: uses swappable conditions for From d5e62d67d5fb2d6037cb9735d5e606fe8469b85b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 18 Jun 2018 06:55:44 -0700 Subject: [PATCH 21/33] [concepts.general][library.general] concepts constrain template arguments, not parameters --- source/concepts.tex | 2 +- source/lib-intro.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 5980cc50a9..6a5b75dd69 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -5,7 +5,7 @@ \pnum This Clause describes library components that \Cpp{} programs may use to perform -compile-time validation of template parameters and perform function dispatch +compile-time validation of template arguments and perform function dispatch based on properties of types. The purpose of these concepts is to establish a foundation for equational reasoning in programs. diff --git a/source/lib-intro.tex b/source/lib-intro.tex index ba50a8e215..509007f2ce 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -46,7 +46,7 @@ \pnum The concepts library\iref{concepts} describes library components that \Cpp{} -programs may use to perform compile-time validation of template parameters and +programs may use to perform compile-time validation of template arguments and perform function dispatch based on properties of types. \pnum From 0301e375e4ebc2ec358079b18b376222bae2c554 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 23:22:27 -0700 Subject: [PATCH 22/33] [concept.convertibleto] Add clarifying comment --- source/concepts.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/concepts.tex b/source/concepts.tex index 6a5b75dd69..994a3e0c8c 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -348,7 +348,9 @@ \begin{itemdecl} template concept ConvertibleTo = is_convertible_v && - requires(From (&f)()) { static_cast(f()); }; + requires(From (&f)()) { // f refers to an arbitrary function such that + static_cast(f()); // f() is an equality-preserving expression + }; \end{itemdecl} \begin{itemdescr} From e0aa860c007e9d064b9258c5deec201d0333b043 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 19 Jun 2018 16:06:03 -0700 Subject: [PATCH 23/33] [structure.requirements] Rephrase para 8 for clarity --- source/lib-intro.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 509007f2ce..01cce27a68 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -505,8 +505,8 @@ \pnum A declaration may explicitly impose requirements through its associated constraints\iref{temp.constr.decl}. When the associated constraints refer to a -concept\iref{temp.concept}, additional semantic requirements are imposed on the -use of the declaration. +concept\iref{temp.concept}, the semantic constraints specified for that concept +are additionally imposed on the use of the declaration. \rSec3[structure.specifications]{Detailed specifications} From a9113be4514c71e56458bfdcd03f0871df8bed69 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 19 Jun 2018 16:31:00 -0700 Subject: [PATCH 24/33] [meta.trans.other] make style of common_type and common_reference consistent ...by tagging the specification of common_reference with "Note C" and basic_common_reference "Note D". Also remove the allowance to specialize basic_common_reference "if at least one template parameter in the specialization depends on a program-defined type"; it's redundant with "...pursuant to [namespace.std]". (This is consistent with `common_type`'s wording.) --- source/utilities.tex | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index cc36e0d865..98fdcab5b6 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16993,10 +16993,8 @@ \tcode{struct} \hspace*{2ex}\tcode{basic_common_reference;} & - A program may specialize this trait if at least one - template parameter in the specialization depends on a program-defined - type. If there is a member \tcode{type}, it shall be a - \grammarterm{typedef-name}. + A program may specialize this trait (as specified in Note D, below). If there + is a member \tcode{type}, it shall be a \grammarterm{typedef-name}. \begin{note} Such specializations can be used to influence the result of \tcode{common_reference}. @@ -17006,8 +17004,8 @@ \tcode{template } \tcode{struct common_reference;} & The member \grammarterm{typedef-name} \tcode{type} is defined or omitted - as specified below. Each type in the parameter pack \tcode{T} shall be - complete or (possibly \cv) \tcode{void}. \\ \rowsep + as specified in Note C, below. Each type in the parameter pack \tcode{T} shall + be complete or (possibly \cv) \tcode{void}. \\ \rowsep \indexlibrary{\idxcode{underlying_type}}% \tcode{template}\br @@ -17182,9 +17180,9 @@ No diagnostic is required for a violation of this Note's rules. \pnum -For the \tcode{common_reference} trait applied to a parameter pack \tcode{T} of -types, the member \tcode{type} shall be either defined or not present as -follows: +Note C: For the \tcode{common_reference} trait applied to a parameter pack +\tcode{T} of types, the member \tcode{type} shall be either defined or not +present as follows: \begin{itemize} \item If \tcode{sizeof...(T)} is zero, there shall be no member \tcode{type}. @@ -17226,7 +17224,7 @@ \end{itemize} \pnum -Notwithstanding the provisions of \ref{meta.type.synop}, and +Note D: Notwithstanding the provisions of \ref{meta.type.synop}, and pursuant to \ref{namespace.std}, a program may specialize \tcode{basic_common_reference} for types \tcode{T} and \tcode{U} such that From 089a362b078e512a769847a96adc10024225f42b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 11:21:43 -0700 Subject: [PATCH 25/33] [meta.trans.other] Remove basic_common_reference requirement with no normative effect ...except to make some programs ill-formed NDR. Also clarify that users may *partially* specialize basic_common_reference. --- source/utilities.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 98fdcab5b6..d4c37b1848 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17225,7 +17225,7 @@ \pnum Note D: Notwithstanding the provisions of \ref{meta.type.synop}, and -pursuant to \ref{namespace.std}, a program may specialize +pursuant to \ref{namespace.std}, a program may partially specialize \tcode{basic_common_reference} for types \tcode{T} and \tcode{U} such that \tcode{is_same_v{>}} and @@ -17241,9 +17241,7 @@ Moreover, \tcode{basic_common_reference::type} shall denote the same type, if any, as does \tcode{basic_common_reference::type}. -A program shall not specialize \tcode{basic_common_reference} on the third or -fourth parameters, \tcode{TQual} or \tcode{UQual}. No diagnostic is required for -a violation of these rules. +No diagnostic is required for a violation of these rules. \pnum \begin{example} From 939e8dcfe8cabd2a36f12de3b415035fde3b0f41 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 20 Jun 2018 09:39:06 -0700 Subject: [PATCH 26/33] [rand.req.urng] Rework URBG requirements for clarity and simplicitly ... by removing the redundance between the new concept and the "old" requirements. Also fixup the reference in [rand.req.eng] to properly refer [rand.req.urng] instead of the requirements table. The table has been removed, and the reference should have been to the subclause in the first place to clearly incorporate the requirements outside of the table. --- source/numerics.tex | 93 +++++++-------------------------------------- 1 file changed, 14 insertions(+), 79 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 1d9c2acaf3..9b94024464 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -2018,82 +2018,6 @@ is often determined statistically. \end{note} -\pnum -A class \tcode{G} -satisfies the requirements -of a \term{uniform random bit generator} -if the expressions shown -in \tref{UniformRandomBitGenerator} -are valid and have the indicated semantics, -and if \tcode{G} also satisfies all other requirements -of this subclause \ref{rand.req.urng}. -In that Table and throughout this subclause: -\begin{enumeratea} - \item - \tcode{T} is the type named by - \tcode{G}'s associated \tcode{result_type}, - and - \item - \tcode{g} is a value of \tcode{G}. -\end{enumeratea} - -\begin{libreqtab4d} - {Uniform random bit generator requirements} - {tab:UniformRandomBitGenerator} -\\ \topline -\lhdr{Expression} - & \chdr{Return type} - & \chdr{Pre/post-condition} - & \rhdr{Complexity} - \\ \capsep -\endfirsthead -\hline -\lhdr{Expression} - & \chdr{Return type} - & \chdr{Pre/post-condition} - & \rhdr{Complexity} - \\ \capsep -\endhead -\indextext{\idxcode{result_type}!uniform random bit generator requirement}% -\tcode{G::result_type} - & \tcode{T} - & \tcode{T} is an unsigned integer type\iref{basic.fundamental}. - & compile-time - \\ \rowsep -\tcode{g()}% -\indextext{\idxcode{operator()}!uniform random bit generator requirement} - & \tcode{T} - & Returns a value in the closed interval - $[$\tcode{G::min()}, \tcode{G::max()}$]$. - & amortized constant - \\ \rowsep -\tcode{G::min()}% -\indextext{\idxcode{min}!uniform random bit generator requirement} - & \tcode{T} - & Denotes the least value potentially returned - by \tcode{operator()}. - & compile-time - \\ \rowsep -\tcode{G::max()} -\indextext{\idxcode{max}!uniform random bit generator requirement} - & \tcode{T} - & Denotes the greatest value potentially returned - by \tcode{operator()}. - & compile-time - \\ -\end{libreqtab4d} - -\pnum -The following relation shall hold: -\tcode{G::min() < G::max()}. -\indextext{requirements!uniform random bit generator|)}% -\indextext{uniform random bit generator!requirements|)} - -\pnum -The \libconcept{UniformRandomBitGenerator} concept is a slight relaxation of the -uniform random bit generator requirements, in that it does not require a nested -\grammarterm{typedef-name} \tcode{result_type}. - \begin{codeblock} template concept UniformRandomBitGenerator = @@ -2105,8 +2029,8 @@ \end{codeblock} \pnum -Let \tcode{g} be an object of type \tcode{G}. -\tcode{\libconcept{UniformRandomBitGenerator}} is satisfied only if +Let \tcode{g} be an object of type \tcode{G}. \tcode{G} models +\libconcept{UniformRandomBitGenerator} only if \begin{itemize} \item Both \tcode{G::min()} and \tcode{G::max()} are constant @@ -2117,6 +2041,17 @@ \item \tcode{g()} has amortized constant complexity. \end{itemize} +\indextext{requirements!uniform random bit generator|)}% +\indextext{uniform random bit generator!requirements|)}% +\pnum +A class \tcode{G} meets the \term{uniform random bit generator} requirements if +\tcode{G} models \libconcept{UniformRandomBitGenerator}, +\tcode{invoke_result_t} is an unsigned integer type\iref{basic.fundamental}, +and +\tcode{G} provides a nested \grammarterm{typedef-name} \tcode{result_type} +that denotes the same type as \tcode{invoke_result_t}. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Random Number Engine requirements: @@ -2291,7 +2226,7 @@ \state{e}{i+1} $= \mathsf{TA}($\state{e}{i}$)$ and returns $\mathsf{GA}($\state{e}{i}$)$. - & per \tref{UniformRandomBitGenerator} + & per \ref{rand.req.urng} \\ \rowsep \tcode{e.discard(z)}% \indextext{\idxcode{discard}!random number engine requirement} From a9981a4425ea3647f08f438e4233407034213ebb Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 21 Jun 2018 11:50:40 -0700 Subject: [PATCH 27/33] [meta.trans.other] Simplify common_type ... by replacing "a type \tcode{U} such that \tcode{is_same_v>} is \tcode{true}" with "a non-reference cv-unqualified type \tcode{U}" --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index d4c37b1848..f63e83b7ee 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17065,8 +17065,8 @@ \tcode{add_lvalue_reference_t{}>}, \item \tcode{\placeholdernc{XREF}(A)} denote a unary class template \tcode{T} such that \tcode{T} denotes the same type as \tcode{U} with the addition - of \tcode{A}'s cv and reference qualifiers, for a type \tcode{U} such - that \tcode{is_same_v>} is \tcode{true}, + of \tcode{A}'s cv and reference qualifiers, for a non-reference cv-unqualified + type \tcode{U}, \item \tcode{\placeholdernc{COPYCV}(FROM, TO)} be an alias for type \tcode{TO} with the addition of \tcode{FROM}'s top-level cv-qualifiers. \begin{example} From ebe222d20ff0107e04c629b33396c4bd60a5891a Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 12:56:10 -0700 Subject: [PATCH 28/33] [concepts] Replace "template <" with "template<" Also fix occurrences introduced by P898R3 in [rand.synopsis], [rand.req.urng], [func.identity], [meta.type.synop], and [meta.trans.other] --- source/concepts.tex | 140 +++++++++++++++++++++---------------------- source/numerics.tex | 4 +- source/utilities.tex | 14 ++--- 3 files changed, 79 insertions(+), 79 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 994a3e0c8c..dacf73a830 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -79,7 +79,7 @@ \begin{example} \begin{codeblock} -template +template concept C = requires(T a, T b, const T c, const T d) { c == d; // \#1 @@ -137,123 +137,123 @@ namespace std { // \ref{concepts.lang}, language-related concepts: // \ref{concept.same}, Same: - template + template concept Same = @\seebelow@; // \ref{concept.derivedfrom}, DerivedFrom: - template + template concept DerivedFrom = @\seebelow@; // \ref{concept.convertibleto}, ConvertibleTo: - template + template concept ConvertibleTo = @\seebelow@; // \ref{concept.commonref}, CommonReference: - template + template concept CommonReference = @\seebelow@; // \ref{concept.common}, Common: - template + template concept Common = @\seebelow@; // \ref{concept.integral}, Integral: - template + template concept Integral = @\seebelow@; // \ref{concept.signed.int}, SignedIntegral: - template + template concept SignedIntegral = @\seebelow@; // \ref{concept.unsigned.int}, UnsignedIntegral: - template + template concept UnsignedIntegral = @\seebelow@; // \ref{concept.assignable}, Assignable: - template + template concept Assignable = @\seebelow@; // \ref{concept.swappable}, Swappable: - template + template concept Swappable = @\seebelow@; - template + template concept SwappableWith = @\seebelow@; // \ref{concept.destructible}, Destructible: - template + template concept Destructible = @\seebelow@; // \ref{concept.constructible}, Constructible: - template + template concept Constructible = @\seebelow@; // \ref{concept.defaultconstructible}, DefaultConstructible: - template + template concept DefaultConstructible = @\seebelow@; // \ref{concept.moveconstructible}, MoveConstructible: - template + template concept MoveConstructible = @\seebelow@; // \ref{concept.copyconstructible}, CopyConstructible: - template + template concept CopyConstructible = @\seebelow@; // \ref{concepts.compare}, comparison concepts: // \ref{concept.boolean}, Boolean: - template + template concept Boolean = @\seebelow@; // \ref{concept.equalitycomparable}, EqualityComparable: - template + template concept EqualityComparable = @\seebelow@; - template + template concept EqualityComparableWith = @\seebelow@; // \ref{concept.stricttotallyordered}, StrictTotallyOrdered: - template + template concept StrictTotallyOrdered = @\seebelow@; - template + template concept StrictTotallyOrderedWith = @\seebelow@; // \ref{concepts.object}, object concepts: // \ref{concept.movable}, Movable: - template + template concept Movable = @\seebelow@; // \ref{concept.copyable}, Copyable: - template + template concept Copyable = @\seebelow@; // \ref{concept.semiregular}, Semiregular: - template + template concept Semiregular = @\seebelow@; // \ref{concept.regular}, Regular: - template + template concept Regular = @\seebelow@; // \ref{concepts.callable}, callable concepts: // \ref{concept.invocable}, Invocable: - template + template concept Invocable = @\seebelow@; // \ref{concept.regularinvocable}, RegularInvocable: - template + template concept RegularInvocable = @\seebelow@; // \ref{concept.predicate}, Predicate: - template + template concept Predicate = @\seebelow@; // \ref{concept.relation}, Relation: - template + template concept Relation = @\seebelow@; // \ref{concept.strictweakorder}, StrictWeakOrder: - template + template concept StrictWeakOrder = @\seebelow@; } \end{codeblock} @@ -274,15 +274,15 @@ relationship between the concept and the type trait. Given the following set of declarations: \begin{codeblock} -template concept C1 = is_c1_v; -template concept C2 = C1 && true; +template concept C1 = is_c1_v; +template concept C2 = C1 && true; -template void f(T); // \#1 -template void f(T); // \#2 +template void f(T); // \#1 +template void f(T); // \#2 -template +template void g(T) requires is_c1_v; // \#3 -template void g(T); // \#4 +template void g(T); // \#4 \end{codeblock} Since \tcode{C2} subsumes \tcode{C1}, the expression \tcode{f(42)} unambiguously calls \#2. \tcode{g(42)}, however, is potentially ambiguous if there need be no @@ -293,7 +293,7 @@ \indexlibrary{\idxcode{Same}}% \begin{itemdecl} -template +template concept Same = is_same_v; \end{itemdecl} @@ -313,7 +313,7 @@ \indexlibrary{\idxcode{DerivedFrom}}% \begin{itemdecl} -template +template concept DerivedFrom = is_base_of_v && is_convertible_v; \end{itemdecl} @@ -346,7 +346,7 @@ \indexlibrary{\idxcode{ConvertibleTo}}% \begin{itemdecl} -template +template concept ConvertibleTo = is_convertible_v && requires(From (&f)()) { // f refers to an arbitrary function such that static_cast(f()); // f() is an equality-preserving expression @@ -411,7 +411,7 @@ \indexlibrary{\idxcode{CommonReference}}% \begin{itemdecl} -template +template concept CommonReference = Same, common_reference_t> && ConvertibleTo> && @@ -451,7 +451,7 @@ \indexlibrary{\idxcode{Common}}% \begin{itemdecl} -template +template concept Common = Same, common_type_t> && ConvertibleTo> && @@ -493,7 +493,7 @@ \indexlibrary{\idxcode{Integral}}% \begin{itemdecl} -template +template concept Integral = is_integral_v; \end{itemdecl} @@ -509,7 +509,7 @@ \indexlibrary{\idxcode{SignedIntegral}}% \begin{itemdecl} -template +template concept SignedIntegral = Integral && is_signed_v; \end{itemdecl} @@ -531,7 +531,7 @@ \indexlibrary{\idxcode{UnsignedIntegral}}% \begin{itemdecl} -template +template concept UnsignedIntegral = Integral && !SignedIntegral; \end{itemdecl} @@ -547,7 +547,7 @@ \indexlibrary{\idxcode{Assignable}}% \begin{itemdecl} -template +template concept Assignable = is_lvalue_reference_v && CommonReference&, const remove_reference_t&> && @@ -605,7 +605,7 @@ \indexlibrary{\idxcode{Swappable}}% \begin{itemdecl} -template +template concept Swappable = is_swappable_v; \end{itemdecl} @@ -638,7 +638,7 @@ \indexlibrary{\idxcode{SwappableWith}}% \begin{itemdecl} -template +template concept SwappableWith = is_swappable_with_v && is_swappable_with_v && CommonReference&, const remove_reference_t&> && @@ -712,14 +712,14 @@ #include #include -template U> +template U> void value_swap(T&& t, U&& u) { using std::swap; swap(std::forward(t), std::forward(u)); // OK: uses ``swappable with'' conditions // for rvalues and lvalues } -template +template void lv_swap(T& t1, T& t2) { using std::swap; swap(t1, t2); // OK: uses swappable conditions for @@ -759,7 +759,7 @@ \indexlibrary{\idxcode{Destructible}}% \begin{itemdecl} -template +template concept Destructible = is_nothrow_destructible_v; \end{itemdecl} @@ -785,7 +785,7 @@ \indexlibrary{\idxcode{Constructible}}% \begin{itemdecl} -template +template concept Constructible = Destructible && is_constructible_v; \end{itemdecl} @@ -801,7 +801,7 @@ \indexlibrary{\idxcode{DefaultConstructible}}% \begin{itemdecl} -template +template concept DefaultConstructible = Constructible; \end{itemdecl} @@ -809,7 +809,7 @@ \indexlibrary{\idxcode{MoveConstructible}}% \begin{itemdecl} -template +template concept MoveConstructible = Constructible && ConvertibleTo; \end{itemdecl} @@ -833,7 +833,7 @@ \indexlibrary{\idxcode{CopyConstructible}}% \begin{itemdecl} -template +template concept CopyConstructible = MoveConstructible && Constructible && ConvertibleTo && Constructible && ConvertibleTo && @@ -870,7 +870,7 @@ \indexlibrary{\idxcode{Boolean}}% \begin{itemdecl} -template +template concept Boolean = Movable> && // (see \ref{concept.movable}) requires(const remove_reference_t& b1, const remove_reference_t& b2, const bool a) { @@ -925,7 +925,7 @@ \rSec2[concept.equalitycomparable]{Concept \libconcept{EqualityComparable}} \begin{itemdecl} -template +template concept @\placeholder{weakly-equality-comparable-with}@ = // \expos requires(const remove_reference_t& t, const remove_reference_t& u) { @@ -954,7 +954,7 @@ \indexlibrary{\idxcode{EqualityComparable}}% \begin{itemdecl} -template +template concept EqualityComparable = @\placeholder{weakly-equality-comparable-with}@; \end{itemdecl} @@ -974,7 +974,7 @@ \indexlibrary{\idxcode{EqualityComparableWith}}% \begin{itemdecl} -template +template concept EqualityComparableWith = EqualityComparable && EqualityComparable && CommonReference&, const remove_reference_t&> && @@ -1001,7 +1001,7 @@ \indexlibrary{\idxcode{StrictTotallyOrdered}}% \begin{itemdecl} -template +template concept StrictTotallyOrdered = EqualityComparable && requires(const remove_reference_t& a, const remove_reference_t& b) { @@ -1031,7 +1031,7 @@ \end{itemdescr} \begin{itemdecl} -template +template concept StrictTotallyOrderedWith = StrictTotallyOrdered && StrictTotallyOrdered && CommonReference&, const remove_reference_t&> && StrictTotallyOrdered< @@ -1085,7 +1085,7 @@ \indexlibrary{\idxcode{Movable}}% \begin{itemdecl} -template +template concept Movable = is_object_v && MoveConstructible && Assignable && Swappable; \end{itemdecl} @@ -1101,7 +1101,7 @@ \indexlibrary{\idxcode{Copyable}}% \begin{itemdecl} -template +template concept Copyable = CopyConstructible && Movable && Assignable; \end{itemdecl} @@ -1109,7 +1109,7 @@ \indexlibrary{\idxcode{Semiregular}}% \begin{itemdecl} -template +template concept Semiregular = Copyable && DefaultConstructible; \end{itemdecl} @@ -1126,7 +1126,7 @@ \indexlibrary{\idxcode{Regular}}% \begin{itemdecl} -template +template concept Regular = Semiregular && EqualityComparable; \end{itemdecl} @@ -1156,7 +1156,7 @@ \indexlibrary{\idxcode{Invocable}}% \begin{itemdecl} -template +template concept Invocable = requires(F&& f, Args&&... args) { invoke(std::forward(f), std::forward(args)...); // not required to be equality-preserving }; @@ -1175,7 +1175,7 @@ \indexlibrary{\idxcode{RegularInvocable}}% \begin{itemdecl} -template +template concept RegularInvocable = Invocable; \end{itemdecl} @@ -1206,7 +1206,7 @@ \indexlibrary{\idxcode{Predicate}}% \begin{itemdecl} -template +template concept Predicate = RegularInvocable && Boolean>; \end{itemdecl} @@ -1215,7 +1215,7 @@ \indexlibrary{\idxcode{Relation}}% \begin{itemdecl} -template +template concept Relation = Predicate && Predicate && CommonReference&, const remove_reference_t&> && Predicate +template concept StrictWeakOrder = Relation; \end{itemdecl} diff --git a/source/numerics.tex b/source/numerics.tex index 9b94024464..46772121f5 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1626,7 +1626,7 @@ namespace std { // \ref{rand.req.urng}, concept UniformRandomBitGenerator - template + template concept UniformRandomBitGenerator = @\seebelow@; // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} @@ -2019,7 +2019,7 @@ \end{note} \begin{codeblock} -template +template concept UniformRandomBitGenerator = Invocable && UnsignedIntegral> && requires { diff --git a/source/utilities.tex b/source/utilities.tex index f63e83b7ee..de5ee50d29 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -14173,13 +14173,13 @@ \indexlibrary{\idxcode{identity}}% \begin{itemdecl} struct identity { - template + template constexpr T&& operator()(T&& t) const noexcept; using is_transparent = @\unspec@; }; -template +template constexpr T&& operator()(T&& t) const noexcept; \end{itemdecl} @@ -15552,7 +15552,7 @@ template struct enable_if; template struct conditional; template struct common_type; - template class TQual, template class UQual> + template class TQual, template class UQual> struct basic_common_reference { }; template struct common_reference; template struct underlying_type; @@ -16987,9 +16987,9 @@ complete, \cv{}~\tcode{void}, or an array of unknown bound. \\ \rowsep \indexlibrary{\idxcode{basic_common_reference}}% -\tcode{template class,} - \hspace*{2ex}\tcode{template class>} +\tcode{template class,} + \hspace*{2ex}\tcode{template class>} \tcode{struct} \hspace*{2ex}\tcode{basic_common_reference;} & @@ -17001,7 +17001,7 @@ \end{note} \\ \rowsep \indexlibrary{\idxcode{common_reference}}% -\tcode{template } \tcode{struct common_reference;} +\tcode{template} \tcode{struct common_reference;} & The member \grammarterm{typedef-name} \tcode{type} is defined or omitted as specified in Note C, below. Each type in the parameter pack \tcode{T} shall From 53b285d3293bf1e1f727bd6f698e2db67914b035 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 14:16:57 -0700 Subject: [PATCH 29/33] [concepts.syn] Remove trailing ":" from reference comments in synopsis Also fix one occurrence in [functional.syn] introduced by P898R3. --- source/concepts.tex | 62 ++++++++++++++++++++++---------------------- source/utilities.tex | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index dacf73a830..c0b1f3adb7 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -135,124 +135,124 @@ \indexlibrary{\idxhdr{concepts}}% \begin{codeblock} namespace std { - // \ref{concepts.lang}, language-related concepts: - // \ref{concept.same}, Same: + // \ref{concepts.lang}, language-related concepts + // \ref{concept.same}, Same template concept Same = @\seebelow@; - // \ref{concept.derivedfrom}, DerivedFrom: + // \ref{concept.derivedfrom}, DerivedFrom template concept DerivedFrom = @\seebelow@; - // \ref{concept.convertibleto}, ConvertibleTo: + // \ref{concept.convertibleto}, ConvertibleTo template concept ConvertibleTo = @\seebelow@; - // \ref{concept.commonref}, CommonReference: + // \ref{concept.commonref}, CommonReference template concept CommonReference = @\seebelow@; - // \ref{concept.common}, Common: + // \ref{concept.common}, Common template concept Common = @\seebelow@; - // \ref{concept.integral}, Integral: + // \ref{concept.integral}, Integral template concept Integral = @\seebelow@; - // \ref{concept.signed.int}, SignedIntegral: + // \ref{concept.signed.int}, SignedIntegral template concept SignedIntegral = @\seebelow@; - // \ref{concept.unsigned.int}, UnsignedIntegral: + // \ref{concept.unsigned.int}, UnsignedIntegral template concept UnsignedIntegral = @\seebelow@; - // \ref{concept.assignable}, Assignable: + // \ref{concept.assignable}, Assignable template concept Assignable = @\seebelow@; - // \ref{concept.swappable}, Swappable: + // \ref{concept.swappable}, Swappable template concept Swappable = @\seebelow@; template concept SwappableWith = @\seebelow@; - // \ref{concept.destructible}, Destructible: + // \ref{concept.destructible}, Destructible template concept Destructible = @\seebelow@; - // \ref{concept.constructible}, Constructible: + // \ref{concept.constructible}, Constructible template concept Constructible = @\seebelow@; - // \ref{concept.defaultconstructible}, DefaultConstructible: + // \ref{concept.defaultconstructible}, DefaultConstructible template concept DefaultConstructible = @\seebelow@; - // \ref{concept.moveconstructible}, MoveConstructible: + // \ref{concept.moveconstructible}, MoveConstructible template concept MoveConstructible = @\seebelow@; - // \ref{concept.copyconstructible}, CopyConstructible: + // \ref{concept.copyconstructible}, CopyConstructible template concept CopyConstructible = @\seebelow@; - // \ref{concepts.compare}, comparison concepts: - // \ref{concept.boolean}, Boolean: + // \ref{concepts.compare}, comparison concepts + // \ref{concept.boolean}, Boolean template concept Boolean = @\seebelow@; - // \ref{concept.equalitycomparable}, EqualityComparable: + // \ref{concept.equalitycomparable}, EqualityComparable template concept EqualityComparable = @\seebelow@; template concept EqualityComparableWith = @\seebelow@; - // \ref{concept.stricttotallyordered}, StrictTotallyOrdered: + // \ref{concept.stricttotallyordered}, StrictTotallyOrdered template concept StrictTotallyOrdered = @\seebelow@; template concept StrictTotallyOrderedWith = @\seebelow@; - // \ref{concepts.object}, object concepts: - // \ref{concept.movable}, Movable: + // \ref{concepts.object}, object concepts + // \ref{concept.movable}, Movable template concept Movable = @\seebelow@; - // \ref{concept.copyable}, Copyable: + // \ref{concept.copyable}, Copyable template concept Copyable = @\seebelow@; - // \ref{concept.semiregular}, Semiregular: + // \ref{concept.semiregular}, Semiregular template concept Semiregular = @\seebelow@; - // \ref{concept.regular}, Regular: + // \ref{concept.regular}, Regular template concept Regular = @\seebelow@; - // \ref{concepts.callable}, callable concepts: - // \ref{concept.invocable}, Invocable: + // \ref{concepts.callable}, callable concepts + // \ref{concept.invocable}, Invocable template concept Invocable = @\seebelow@; - // \ref{concept.regularinvocable}, RegularInvocable: + // \ref{concept.regularinvocable}, RegularInvocable template concept RegularInvocable = @\seebelow@; - // \ref{concept.predicate}, Predicate: + // \ref{concept.predicate}, Predicate template concept Predicate = @\seebelow@; - // \ref{concept.relation}, Relation: + // \ref{concept.relation}, Relation template concept Relation = @\seebelow@; - // \ref{concept.strictweakorder}, StrictWeakOrder: + // \ref{concept.strictweakorder}, StrictWeakOrder template concept StrictWeakOrder = @\seebelow@; } diff --git a/source/utilities.tex b/source/utilities.tex index de5ee50d29..fc99756109 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -13038,7 +13038,7 @@ template<> struct bit_xor; template<> struct bit_not; - // \ref{func.identity}, identity: + // \ref{func.identity}, identity struct identity; // \ref{func.not_fn}, function template \tcode{not_fn} From acb06e37dd73add5f829a130522aa7db515ca92a Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 20:19:21 -0700 Subject: [PATCH 30/33] macros.tex: change the \oldconcept prefix to "Cpp17" Also update "Cpp98"s in the text to "Cpp17" to agree. --- source/lib-intro.tex | 22 +++++++++++----------- source/macros.tex | 2 +- source/utilities.tex | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 01cce27a68..b4828eafff 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1588,7 +1588,7 @@ \tcode{T()} shall be a well-defined expression\iref{dcl.init} if one of those signatures is called using the default argument\iref{dcl.fct.default}. -\indextext{requirements!\idxcode{Cpp98EqualityComparable}}% +\indextext{requirements!\idxcode{Cpp17EqualityComparable}}% \begin{concepttable}{\oldconcept{EqualityComparable} requirements}{equalitycomparable} {x{1in}x{1in}p{3in}} \topline @@ -1607,7 +1607,7 @@ \end{itemize} \\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98LessThanComparable}}% +\indextext{requirements!\idxcode{Cpp17LessThanComparable}}% \begin{concepttable}{\oldconcept{LessThanComparable} requirements}{lessthancomparable} {x{1in}x{1in}p{3in}} \topline @@ -1618,7 +1618,7 @@ \end{concepttable} \enlargethispage{-3\baselineskip} -\indextext{requirements!\idxcode{Cpp98DefaultConstructible}}% +\indextext{requirements!\idxcode{Cpp17DefaultConstructible}}% \begin{concepttable}{\oldconcept{DefaultConstructible} requirements}{defaultconstructible} {x{2.15in}p{3in}} \topline @@ -1629,7 +1629,7 @@ or aggregate-initialized \\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98MoveConstructible}}% +\indextext{requirements!\idxcode{Cpp17MoveConstructible}}% \begin{concepttable}{\oldconcept{MoveConstructible} requirements}{moveconstructible} {p{1in}p{4.15in}} \topline @@ -1644,7 +1644,7 @@ work as specified whether \tcode{rv} has been moved from or not. \end{note}}\\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98CopyConstructible}}% +\indextext{requirements!\idxcode{Cpp17CopyConstructible}}% \begin{concepttable}{\oldconcept{CopyConstructible} requirements (in addition to \oldconcept{MoveConstructible})}{copyconstructible} {p{1in}p{4.15in}} \topline @@ -1654,7 +1654,7 @@ the value of \tcode{v} is unchanged and is equivalent to \tcode{T(v)} \\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98MoveAssignable}}% +\indextext{requirements!\idxcode{Cpp17MoveAssignable}}% \begin{concepttable}{\oldconcept{MoveAssignable} requirements}{moveassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline @@ -1670,7 +1670,7 @@ work as specified whether \tcode{rv} has been moved from or not. \end{note}}\\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98CopyAssignable}}% +\indextext{requirements!\idxcode{Cpp17CopyAssignable}}% \begin{concepttable}{\oldconcept{CopyAssignable} requirements (in addition to \oldconcept{MoveAssignable})}{copyassignable} {p{1in}p{1in}p{1in}p{1.9in}} \topline @@ -1678,7 +1678,7 @@ \tcode{t = v} & \tcode{T\&} & \tcode{t} & \tcode{t} is equivalent to \tcode{v}, the value of \tcode{v} is unchanged\\ \end{concepttable} -\indextext{requirements!\idxcode{Cpp98Destructible}} +\indextext{requirements!\idxcode{Cpp17Destructible}} \begin{concepttable}{\oldconcept{Destructible} requirements}{destructible} {p{1in}p{4.15in}} \topline @@ -1825,7 +1825,7 @@ denote values of type (possibly \tcode{const}) \tcode{P}, and \tcode{np} denotes a value of type (possibly \tcode{const}) \tcode{std::nullptr_t}. -\indextext{requirements!\idxcode{Cpp98NullablePointer}}% +\indextext{requirements!\idxcode{Cpp17NullablePointer}}% \begin{concepttable}{\oldconcept{NullablePointer} requirements}{nullablepointer} {lll} \topline @@ -1865,7 +1865,7 @@ \rSec3[hash.requirements]{\oldconcept{Hash} requirements} -\indextext{requirements!\idxcode{Cpp98Hash}} +\indextext{requirements!\idxcode{Cpp17Hash}} \pnum A type \tcode{H} meets the \oldconcept{Hash} requirements if: @@ -1903,7 +1903,7 @@ \rSec3[allocator.requirements]{\oldconcept{Allocator} requirements} -\indextext{requirements!\idxcode{Cpp98Allocator}}% +\indextext{requirements!\idxcode{Cpp17Allocator}}% \pnum The library describes a standard set of requirements for \term{allocators}, which are class-type objects that encapsulate the information about an allocation model. diff --git a/source/macros.tex b/source/macros.tex index 14ae54a9b4..e4dbbe1c42 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -317,7 +317,7 @@ \newcommand{\commentellip}{\tcode{/* ...\ */}} %% Concepts -\newcommand{\oldconcept}[1]{\textit{Cpp98#1}} +\newcommand{\oldconcept}[1]{\textit{Cpp17#1}} \newcommand{\libconcept}[1]{\tcode{#1}} %% Ranges diff --git a/source/utilities.tex b/source/utilities.tex index fc99756109..2563c25360 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15330,7 +15330,7 @@ \rSec2[meta.rqmts]{Requirements} \pnum -A \defn{Cpp98UnaryTypeTrait} describes a property +A \defn{Cpp17UnaryTypeTrait} describes a property of a type. It shall be a class template that takes one template type argument and, optionally, additional arguments that help define the property being described. It shall be \oldconcept{DefaultConstructible}, @@ -15345,7 +15345,7 @@ unambiguously available in the \oldconcept{UnaryTypeTrait}. \pnum -A \defn{Cpp98BinaryTypeTrait} describes a +A \defn{Cpp17BinaryTypeTrait} describes a relationship between two types. It shall be a class template that takes two template type arguments and, optionally, additional arguments that help define the relationship being described. It shall @@ -15361,7 +15361,7 @@ unambiguously available in the \oldconcept{BinaryTypeTrait}. \pnum -A \defn{Cpp98TransformationTrait} +A \defn{Cpp17TransformationTrait} modifies a property of a type. It shall be a class template that takes one template type argument and, optionally, additional arguments that help From 7677798914c93e6bc3b335a01bff54194e0996fa Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 20:28:23 -0700 Subject: [PATCH 31/33] [concepts] There need be no "there need be no subsumption relationship" ... the core language rules already imply it. --- source/concepts.tex | 98 --------------------------------------------- 1 file changed, 98 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index c0b1f3adb7..feae79d07b 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -267,28 +267,6 @@ features. These concepts express relationships between types, type classifications, and fundamental type properties. -\pnum -\begin{example} -Several concept specifications in this subclause are specified in terms of a -type trait, and include an annotation that there need be no subsumption -relationship between the concept and the type trait. Given the following set of -declarations: -\begin{codeblock} -template concept C1 = is_c1_v; -template concept C2 = C1 && true; - -template void f(T); // \#1 -template void f(T); // \#2 - -template -void g(T) requires is_c1_v; // \#3 -template void g(T); // \#4 -\end{codeblock} -Since \tcode{C2} subsumes \tcode{C1}, the expression \tcode{f(42)} unambiguously -calls \#2. \tcode{g(42)}, however, is potentially ambiguous if there need be no -subsumption relationship between \tcode{C1} and \tcode{is_c1_v}. -\end{example} - \rSec2[concept.same]{Concept \libconcept{Same}} \indexlibrary{\idxcode{Same}}% @@ -298,12 +276,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Same}} -and -\tcode{is_same_v}. - \pnum \tcode{\libconcept{Same}} subsumes \tcode{\libconcept{Same}} and vice versa. @@ -319,15 +291,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{DerivedFrom}} -and either -\tcode{is_base_of_v} -or -\tcode{is_convertible_v}. - \pnum \begin{note} \tcode{\libconcept{DerivedFrom}} is satisfied if and only if @@ -383,14 +346,7 @@ Otherwise, the object referred to by \tcode{f()} is not modified by either above expression. \end{itemize} - \end{itemize} - -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{ConvertibleTo}} -and -\tcode{is_\-convert\-ible_v\brk{}}. \end{itemdescr} @@ -497,14 +453,6 @@ concept Integral = is_integral_v; \end{itemdecl} -\begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Integral}} -and -\tcode{is_integral_v}. -\end{itemdescr} - \rSec2[concept.signed.int]{Concept \libconcept{SignedIntegral}} \indexlibrary{\idxcode{SignedIntegral}}% @@ -514,12 +462,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{SignedIntegral}} -and -\tcode{is_signed_v}. - \pnum \begin{note} \tcode{\libconcept{SignedIntegral}} can be satisfied even by types that are @@ -586,12 +528,6 @@ \end{itemize} \end{itemize} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Assignable}} -and -\tcode{is_lvalue_refer\-ence_v}. - \pnum \begin{note} Assignment need not be a total function\iref{structure.requirements}; @@ -628,12 +564,6 @@ \item the lookup set produced by argument-dependent lookup\iref{basic.lookup.argdep}. \end{itemize} - -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Swappable}} -and -\tcode{is_swappable_v}. \end{itemdescr} \indexlibrary{\idxcode{SwappableWith}}% @@ -678,12 +608,6 @@ \item the lookup set produced by argument-dependent lookup\iref{basic.lookup.argdep}. \end{itemize} - -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{SwappableWith}} -and any specialization of -\tcode{is_swappable_with_v}. \end{itemdescr} \begin{itemdescr} @@ -764,12 +688,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Destructible}} -and -\tcode{is_\-no\-throw_\-destruct\-ible_v}. - \pnum \begin{note} Unlike the \oldconcept{Destructible} requirements~(\tref{destructible}), this @@ -789,14 +707,6 @@ concept Constructible = Destructible && is_constructible_v; \end{itemdecl} -\begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Constructible}} -and -\tcode{is_const\-ruct\-ible_v}. -\end{itemdescr} - \rSec2[concept.defaultconstructible]{Concept \libconcept{DefaultConstructible}} \indexlibrary{\idxcode{DefaultConstructible}}% @@ -1089,14 +999,6 @@ concept Movable = is_object_v && MoveConstructible && Assignable && Swappable; \end{itemdecl} -\begin{itemdescr} -\pnum -There need be no subsumption relationship between -\tcode{\libconcept{Movable}} -and -\tcode{is_object_v}. -\end{itemdescr} - \rSec2[concept.copyable]{Concept \libconcept{Copyable}} \indexlibrary{\idxcode{Copyable}}% From 6523119e1da32665449effdd155cd10559ae7473 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 20:35:58 -0700 Subject: [PATCH 32/33] [concepts.integral] Merge [concept.integral], [concept.signed.int] and [concept.unsigned.int] --- source/concepts.tex | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index feae79d07b..0a4cc9db5e 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -156,15 +156,13 @@ template concept Common = @\seebelow@; - // \ref{concept.integral}, Integral + // \ref{concepts.integral}, Integral concepts template concept Integral = @\seebelow@; - // \ref{concept.signed.int}, SignedIntegral template concept SignedIntegral = @\seebelow@; - // \ref{concept.unsigned.int}, UnsignedIntegral template concept UnsignedIntegral = @\seebelow@; @@ -445,20 +443,20 @@ \end{itemdescr} -\rSec2[concept.integral]{Concept \libconcept{Integral}} +\rSec2[concepts.integral]{Integral concepts} \indexlibrary{\idxcode{Integral}}% +\indexlibrary{\idxcode{SignedIntegral}}% +\indexlibrary{\idxcode{UnsignedIntegral}}% \begin{itemdecl} template concept Integral = is_integral_v; -\end{itemdecl} -\rSec2[concept.signed.int]{Concept \libconcept{SignedIntegral}} - -\indexlibrary{\idxcode{SignedIntegral}}% -\begin{itemdecl} template concept SignedIntegral = Integral && is_signed_v; + +template +concept UnsignedIntegral = Integral && !SignedIntegral; \end{itemdecl} \begin{itemdescr} @@ -467,21 +465,11 @@ \tcode{\libconcept{SignedIntegral}} can be satisfied even by types that are not signed integral types\iref{basic.fundamental}; for example, \tcode{char}. \end{note} -\end{itemdescr} - -\rSec2[concept.unsigned.int]{Concept \libconcept{UnsignedIntegral}} -\indexlibrary{\idxcode{UnsignedIntegral}}% -\begin{itemdecl} -template -concept UnsignedIntegral = Integral && !SignedIntegral; -\end{itemdecl} - -\begin{itemdescr} \pnum \begin{note} \tcode{\libconcept{UnsignedIntegral}} can be satisfied even by types that are -not unsigned integral types\iref{basic.fundamental}; for example, \tcode{char}. +not unsigned integral types\iref{basic.fundamental}; for example, \tcode{bool}. \end{note} \end{itemdescr} From 11877fc6555180e5aef6f552b838724f7244840b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 22 Jun 2018 21:14:00 -0700 Subject: [PATCH 33/33] [structure.requirements] new para that explains the typographical convention for requirement names --- source/lib-intro.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index b4828eafff..d1ef50e658 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -479,6 +479,18 @@ well-defined expression requirements is described in terms of the valid expressions for its template type parameters. +\pnum +The library specification uses a typographical convention for naming +requirements. Names in \textit{italic} type that begin with the prefix +\oldconcept{} refer to sets of well-defined expression requirements typically +presented in tabular form, possibly with additional prose semantic requirements. +For example, \oldconcept{Destructible}~(\tref{destructible}) is such a named +requirement. Names in \tcode{constant width} type refer to library concepts +which are presented as a concept\iref{temp} definition, possibly with additional +prose semantic requirements. For example, +\libconcept{Destructible}\iref{concept.destructible} +is such a named requirement. + \pnum Template argument requirements are sometimes referenced by name. See~\ref{type.descriptions}.