From b1393edd9944832ff97c850e8acc5f6ec29adda0 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:26:38 +0200 Subject: [PATCH 01/14] LWG2139 What is a user-defined type? Some of the underlying text has changed, and the edits were applied to the changed text. There is one remaining appearance of 'user-defined type' in [namespace.std], which was not changed. --- source/diagnostics.tex | 2 +- source/lib-intro.tex | 22 ++++++++++++++++++++-- source/locales.tex | 2 +- source/regex.tex | 2 +- source/utilities.tex | 8 ++++---- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/source/diagnostics.tex b/source/diagnostics.tex index deceed9aeb..5490119296 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -918,7 +918,7 @@ \pnum The \tcode{is_error_code_enum} and \tcode{is_error_condition_enum} may be -specialized for user-defined types to indicate that such types are eligible +specialized for program-defined types to indicate that such types are eligible for \tcode{class error_code} and \tcode{class error_condition} automatic conversions, respectively. diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 5c271c0f70..5359b4ccfa 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -283,6 +283,24 @@ member functions\iref{class.this}. \end{defnote} +\definition{program-defined specialization}{defns.prog.def.spec} +\indexdefn{specialization!program-defined}% +explicit template specialization or partial specialization +that is not part of the C++ standard library and +not defined by the implementation + +\definition{program-defined type}{defns.prog.def.type} +\indexdefn{type!program-defined}% +class type or enumeration type +that is not part of the C++ standard library and +not defined by the implementation, +or an instantiation of a program-defined specialization + +\begin{defnote} +Types defined by the implementation include +extensions\iref{intro.compliance} and internal types used by the library. +\end{defnote} + \definition{referenceable type}{defns.referenceable} \indexdefn{type!referenceable}% type that is either an @@ -2169,7 +2187,7 @@ to namespace \tcode{std} provided that (a) the added declaration -depends on at least one user-defined type +depends on at least one program-defined type and (b) the specialization meets the standard library requirements for the original template.\footnote{Any @@ -2202,7 +2220,7 @@ A program may explicitly instantiate a class template defined in the standard library only if the declaration -(a) depends on the name of at least one user-defined type +(a) depends on the name of at least one program-defined type and (b) the instantiation meets the standard library requirements for the original template. diff --git a/source/locales.tex b/source/locales.tex index 00f081882e..6d3e8ff556 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -1908,7 +1908,7 @@ Specializations on \tcode{mbstate_t} perform conversion between encodings known to the library implementer. -Other encodings can be converted by specializing on a user-defined +Other encodings can be converted by specializing on a program-defined \tcode{stateT} type. Objects of type diff --git a/source/regex.tex b/source/regex.tex index 148733da5f..12d85edd7a 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -3651,7 +3651,7 @@ \pnum \begin{note} This means that a compiler may call an -implementation-specific search function, in which case a user-defined +implementation-specific search function, in which case a program-defined specialization of \tcode{regex_search} will not be called. \end{note} \end{itemdescr} diff --git a/source/utilities.tex b/source/utilities.tex index ba5c1c4040..4b3003dbf3 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7150,7 +7150,7 @@ is valid and denotes a type\iref{temp.deduct} and \tcode{is_convertible_v != false}, otherwise it shall be derived from \tcode{false_type}. A program may specialize this template to derive from -\tcode{true_type} for a user-defined type \tcode{T} that does not have a nested +\tcode{true_type} for a program-defined type \tcode{T} that does not have a nested \tcode{allocator_type} but nonetheless can be constructed with an allocator where either: @@ -14281,7 +14281,7 @@ 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}. -A program may specialize this template for a user-defined type \tcode{T} +A program may specialize this template for a program-defined type \tcode{T} to have a base characteristic of \tcode{true_type} to indicate that \tcode{T} should be treated as a subexpression in a \tcode{bind} call. @@ -14306,7 +14306,7 @@ \tcode{integral_constant} if \tcode{T} is the type of \tcode{std::placeholders::_\placeholder{J}}, otherwise it shall have a base characteristic of \tcode{integral_constant}. A program -may specialize this template for a user-defined type \tcode{T} to +may specialize this template for a program-defined type \tcode{T} to have a base characteristic of \tcode{integral_constant} with \tcode{N > 0} to indicate that \tcode{T} should be treated as a placeholder type. @@ -15271,7 +15271,7 @@ \item satisfy the requirement that the expression \tcode{h(k)}, where \tcode{h} is an object of type \tcode{hash} and \tcode{k} is an object of type \tcode{Key}, shall not throw an exception unless \tcode{hash} is a -user-defined specialization that depends on at least one user-defined type. +program-defined specialization that depends on at least one program-defined type. \end{itemize} \rSec1[meta]{Metaprogramming and type traits} From 94a91b6c3f7306a2a2c51e74a9d55ae1358b59c1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:32:59 +0200 Subject: [PATCH 02/14] LWG2970 Return type of std::visit misspecified --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 4b3003dbf3..62f2bed8d4 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4868,7 +4868,7 @@ \pnum \returns $e(\tcode{m})$, where \tcode{m} is the pack for which $\tcode{m}_i$ is \tcode{vars$_i$.index()} for -all $0 \leq i < n$. The return type is the type of $e(\tcode{m})$. +all $0 \leq i < n$. The return type is $\tcode{decltype(}e(\tcode{m})\tcode{)}$. \pnum \throws From 1f2a8162cc87ce197584dbb1acadd100282d57a6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:40:08 +0200 Subject: [PATCH 03/14] LWG3058 Parallel adjacent_difference shouldn't require creating temporaries --- source/numerics.tex | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 50e33a2a9f..d6fccab671 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -9414,24 +9414,27 @@ \end{itemdecl} \begin{itemdescr} +\pnum +Let \tcode{T} be the value type of \tcode{decltype(first)}. +For the overloads that do not take an argument \tcode{binary_op}, +let \tcode{binary_op} be an lvalue +that denotes an object of type \tcode{minus<>}. + \pnum \requires \begin{itemize} \item -For the overloads with no \tcode{ExecutionPolicy}, \tcode{InputIterator}'s value -type shall be \tcode{MoveAssignable} (\tref{moveassignable}) and shall +For the overloads with no \tcode{ExecutionPolicy}, +\tcode{T} shall be \tcode{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 \tcode{val - std::move(acc)} or +output iterator. The result of the expression \tcode{binary_op(val, std::move(acc))} shall be writable to the \tcode{result} output iterator. \item -For the overloads with an \tcode{ExecutionPolicy}, the value type of -\tcode{ForwardIterator1} -shall be \tcode{CopyConstructible} (\tref{copyconstructible}), -constructible from the expression \tcode{*first - *first} or -\tcode{binary_op(*first, *first)}, and assignable to the value type of -\tcode{ForwardIterator2}. +For the overloads with an \tcode{ExecutionPolicy}, +the result of the expressions \tcode{binary_op(*first, *first)} and +\tcode{*first} shall be writable to \tcode{result}. \item For all overloads, in the ranges @@ -9445,23 +9448,18 @@ \pnum \effects For the overloads with no \tcode{ExecutionPolicy} and a non-empty range, -the function creates an accumulator \tcode{acc} whose type is \tcode{InputIterator}'s -value type, initializes it with \tcode{*first}, +the function creates an accumulator \tcode{acc} of type \tcode{T}, +initializes it with \tcode{*first}, and assigns the result to \tcode{*result}. For every iterator \tcode{i} in \range{first + 1}{last} -in order, creates an object \tcode{val} whose type is \tcode{InputIterator}'s value type, initializes it -with \tcode{*i}, computes \tcode{val - std::move(acc)} or \tcode{binary_op(val, std::move(acc))}, assigns the result +in order, creates an object \tcode{val} whose type is \tcode{T}, initializes it +with \tcode{*i}, computes \tcode{binary_op(val, std::move(acc))}, assigns the result to \tcode{*(result + (i - first))}, and move assigns from \tcode{val} to \tcode{acc}. \pnum -For the overloads with an \tcode{ExecutionPolicy} and a non-empty range, first the -function creates an object whose type is \tcode{ForwardIterator1}'s value type, -initializes it with \tcode{*first}, and assigns the result to \tcode{*result}. -Then for every \tcode{d} -in \crange{1}{last - first - 1}, creates an object \tcode{val} whose type is -\tcode{ForwardIterator1}'s value type, initializes it with -\tcode{*(first + d) - *(first + d - 1)} or -\tcode{binary_op(*(first + d), *(first + d - 1))}, and assigns the result to -\tcode{*(result + d)}. +For the overloads with an \tcode{ExecutionPolicy} and a non-empty range, +performs \tcode{*result = *first}. +Then, for every \tcode{d} in \tcode{[1, last - first - 1]}, +performs \tcode{*(result + d) = binary_op(*(first + d), *(first + (d - 1)))}. \pnum \returns From f39081c3f90500d566de5532f2aa3ddfd62e4ef9 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:45:39 +0200 Subject: [PATCH 04/14] LWG3062 Unnecessary decay_t in is_execution_policy_v should be remove_cvref_t --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 42383f296e..bba20d0d86 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -1550,7 +1550,7 @@ \pnum Parallel algorithms shall not participate in overload resolution unless -\tcode{is_execution_policy_v>} is \tcode{true}. +\tcode{is_execution_policy_v>} is \tcode{true}. \rSec1[alg.nonmodifying]{Non-modifying sequence operations} From 432136995137b96227c56cdb3c252acf87531322 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:48:21 +0200 Subject: [PATCH 05/14] LWG3067 recursive_directory_iterator::pop must invalidate --- source/iostreams.tex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/iostreams.tex b/source/iostreams.tex index bde3cbbf1f..eb0aff6a57 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -14337,6 +14337,11 @@ Otherwise, cease iteration of the directory currently being iterated over, and continue iteration over the parent directory. +\pnum +\postconditions Any copies of the previous value of \tcode{*this} +are no longer required +either to be dereferenceable or to be in the domain of \tcode{==}. + \pnum \throws As specified in~\ref{fs.err.report}. \end{itemdescr} From d7a10e8fc3315b60bb0e9f8af85fa7c055f9c478 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:55:38 +0200 Subject: [PATCH 06/14] LWG3074 Non-member functions for valarray should only deduce from the valarray --- source/numerics.tex | 234 +++++++++++++++++++++++++++++--------------- 1 file changed, 154 insertions(+), 80 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index d6fccab671..8bff56b694 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -6327,72 +6327,108 @@ template void swap(valarray&, valarray&) noexcept; template valarray operator* (const valarray&, const valarray&); - template valarray operator* (const valarray&, const T&); - template valarray operator* (const T&, const valarray&); + template valarray operator* (const valarray&, + const typename valarray::value_type&); + template valarray operator* (const typename valarray::value_type&, + const valarray&); template valarray operator/ (const valarray&, const valarray&); - template valarray operator/ (const valarray&, const T&); - template valarray operator/ (const T&, const valarray&); + template valarray operator/ (const valarray&, + const typename valarray::value_type&); + template valarray operator/ (const typename valarray::value_type&, + const valarray&); template valarray operator% (const valarray&, const valarray&); - template valarray operator% (const valarray&, const T&); - template valarray operator% (const T&, const valarray&); + template valarray operator% (const valarray&, + const typename valarray::value_type&); + template valarray operator% (const typename valarray::value_type&, + const valarray&); template valarray operator+ (const valarray&, const valarray&); - template valarray operator+ (const valarray&, const T&); - template valarray operator+ (const T&, const valarray&); + template valarray operator+ (const valarray&, + const typename valarray::value_type&); + template valarray operator+ (const typename valarray::value_type&, + const valarray&); template valarray operator- (const valarray&, const valarray&); - template valarray operator- (const valarray&, const T&); - template valarray operator- (const T&, const valarray&); + template valarray operator- (const valarray&, + const typename valarray::value_type&); + template valarray operator- (const typename valarray::value_type&, + const valarray&); template valarray operator^ (const valarray&, const valarray&); - template valarray operator^ (const valarray&, const T&); - template valarray operator^ (const T&, const valarray&); + template valarray operator^ (const valarray&, + const typename valarray::value_type&); + template valarray operator^ (const typename valarray::value_type&, + const valarray&); template valarray operator& (const valarray&, const valarray&); - template valarray operator& (const valarray&, const T&); - template valarray operator& (const T&, const valarray&); + template valarray operator& (const valarray&, + const typename valarray::value_type&); + template valarray operator& (const typename valarray::value_type&, + const valarray&); template valarray operator| (const valarray&, const valarray&); - template valarray operator| (const valarray&, const T&); - template valarray operator| (const T&, const valarray&); + template valarray operator| (const valarray&, + const typename valarray::value_type&); + template valarray operator| (const typename valarray::value_type&, + const valarray&); template valarray operator<<(const valarray&, const valarray&); - template valarray operator<<(const valarray&, const T&); - template valarray operator<<(const T&, const valarray&); + template valarray operator<<(const valarray&, + const typename valarray::value_type&); + template valarray operator<<(const typename valarray::value_type&, + const valarray&); template valarray operator>>(const valarray&, const valarray&); - template valarray operator>>(const valarray&, const T&); - template valarray operator>>(const T&, const valarray&); + template valarray operator>>(const valarray&, + const typename valarray::value_type&); + template valarray operator>>(const typename valarray::value_type&, + const valarray&); template valarray operator&&(const valarray&, const valarray&); - template valarray operator&&(const valarray&, const T&); - template valarray operator&&(const T&, const valarray&); + template valarray operator&&(const valarray&, + const typename valarray::value_type&); + template valarray operator&&(const typename valarray::value_type&, + const valarray&); template valarray operator||(const valarray&, const valarray&); - template valarray operator||(const valarray&, const T&); - template valarray operator||(const T&, const valarray&); + template valarray operator||(const valarray&, + const typename valarray::value_type&); + template valarray operator||(const typename valarray::value_type&, + const valarray&); template valarray operator==(const valarray&, const valarray&); - template valarray operator==(const valarray&, const T&); - template valarray operator==(const T&, const valarray&); + template valarray operator==(const valarray&, + const typename valarray::value_type&); + template valarray operator==(const typename valarray::value_type&, + const valarray&); template valarray operator!=(const valarray&, const valarray&); - template valarray operator!=(const valarray&, const T&); - template valarray operator!=(const T&, const valarray&); + template valarray operator!=(const valarray&, + const typename valarray::value_type&); + template valarray operator!=(const typename valarray::value_type&, + const valarray&); template valarray operator< (const valarray&, const valarray&); - template valarray operator< (const valarray&, const T&); - template valarray operator< (const T&, const valarray&); + template valarray operator< (const valarray&, + const typename valarray::value_type&); + template valarray operator< (const typename valarray::value_type&, + const valarray&); template valarray operator> (const valarray&, const valarray&); - template valarray operator> (const valarray&, const T&); - template valarray operator> (const T&, const valarray&); + template valarray operator> (const valarray&, + const typename valarray::value_type&); + template valarray operator> (const typename valarray::value_type&, + const valarray&); template valarray operator<=(const valarray&, const valarray&); - template valarray operator<=(const valarray&, const T&); - template valarray operator<=(const T&, const valarray&); + template valarray operator<=(const valarray&, + const typename valarray::value_type&); + template valarray operator<=(const typename valarray::value_type&, + const valarray&); template valarray operator>=(const valarray&, const valarray&); - template valarray operator>=(const valarray&, const T&); - template valarray operator>=(const T&, const valarray&); + template valarray operator>=(const valarray&, + const typename valarray::value_type&); + template valarray operator>=(const typename valarray::value_type&, + const valarray&); template valarray abs (const valarray&); template valarray acos (const valarray&); @@ -6400,8 +6436,10 @@ template valarray atan (const valarray&); template valarray atan2(const valarray&, const valarray&); - template valarray atan2(const valarray&, const T&); - template valarray atan2(const T&, const valarray&); + template valarray atan2(const valarray&, + const typename valarray::value_type&); + template valarray atan2(const typename valarray::value_type&, + const valarray&); template valarray cos (const valarray&); template valarray cosh (const valarray&); @@ -6410,8 +6448,8 @@ template valarray log10(const valarray&); template valarray pow(const valarray&, const valarray&); - template valarray pow(const valarray&, const T&); - template valarray pow(const T&, const valarray&); + template valarray pow(const valarray&, const typename valarray::value_type&); + template valarray pow(const typename valarray::value_type&, const valarray&); template valarray sin (const valarray&); template valarray sinh (const valarray&); @@ -7406,26 +7444,46 @@ \indexlibrarymember{operator<<}{valarray}% \indexlibrarymember{operator>>}{valarray}% \begin{itemdecl} -template valarray operator* (const valarray&, const T&); -template valarray operator* (const T&, const valarray&); -template valarray operator/ (const valarray&, const T&); -template valarray operator/ (const T&, const valarray&); -template valarray operator% (const valarray&, const T&); -template valarray operator% (const T&, const valarray&); -template valarray operator+ (const valarray&, const T&); -template valarray operator+ (const T&, const valarray&); -template valarray operator- (const valarray&, const T&); -template valarray operator- (const T&, const valarray&); -template valarray operator^ (const valarray&, const T&); -template valarray operator^ (const T&, const valarray&); -template valarray operator& (const valarray&, const T&); -template valarray operator& (const T&, const valarray&); -template valarray operator| (const valarray&, const T&); -template valarray operator| (const T&, const valarray&); -template valarray operator<<(const valarray&, const T&); -template valarray operator<<(const T&, const valarray&); -template valarray operator>>(const valarray&, const T&); -template valarray operator>>(const T&, const valarray&); +template valarray operator* (const valarray&, + const typename valarray::value_type&); +template valarray operator* (const typename valarray::value_type&, + const valarray&); +template valarray operator/ (const valarray&, + const typename valarray::value_type&); +template valarray operator/ (const typename valarray::value_type&, + const valarray&); +template valarray operator% (const valarray&, + const typename valarray::value_type&); +template valarray operator% (const typename valarray::value_type&, + const valarray&); +template valarray operator+ (const valarray&, + const typename valarray::value_type&); +template valarray operator+ (const typename valarray::value_type&, + const valarray&); +template valarray operator- (const valarray&, + const typename valarray::value_type&); +template valarray operator- (const typename valarray::value_type&, + const valarray&); +template valarray operator^ (const valarray&, + const typename valarray::value_type&); +template valarray operator^ (const typename valarray::value_type&, + const valarray&); +template valarray operator& (const valarray&, + const typename valarray::value_type&); +template valarray operator& (const typename valarray::value_type&, + const valarray&); +template valarray operator| (const valarray&, + const typename valarray::value_type&); +template valarray operator| (const typename valarray::value_type&, + const valarray&); +template valarray operator<<(const valarray&, + const typename valarray::value_type&); +template valarray operator<<(const typename valarray::value_type&, + const valarray&); +template valarray operator>>(const valarray&, + const typename valarray::value_type&); +template valarray operator>>(const typename valarray::value_type&, + const valarray&); \end{itemdecl} \begin{itemdescr} @@ -7494,22 +7552,38 @@ \indexlibrarymember{operator\&\&}{valarray}% \indexlibrarymember{operator"|"|}{valarray}% \begin{itemdecl} -template valarray operator==(const valarray&, const T&); -template valarray operator==(const T&, const valarray&); -template valarray operator!=(const valarray&, const T&); -template valarray operator!=(const T&, const valarray&); -template valarray operator< (const valarray&, const T&); -template valarray operator< (const T&, const valarray&); -template valarray operator> (const valarray&, const T&); -template valarray operator> (const T&, const valarray&); -template valarray operator<=(const valarray&, const T&); -template valarray operator<=(const T&, const valarray&); -template valarray operator>=(const valarray&, const T&); -template valarray operator>=(const T&, const valarray&); -template valarray operator&&(const valarray&, const T&); -template valarray operator&&(const T&, const valarray&); -template valarray operator||(const valarray&, const T&); -template valarray operator||(const T&, const valarray&); +template valarray operator==(const valarray&, + const typename valarray::value_type&); +template valarray operator==(const typename valarray::value_type&, + const valarray&); +template valarray operator!=(const valarray&, + const typename valarray::value_type&); +template valarray operator!=(const typename valarray::value_type&, + const valarray&); +template valarray operator< (const valarray&, + const typename valarray::value_type&); +template valarray operator< (const typename valarray::value_type&, + const valarray&); +template valarray operator> (const valarray&, + const typename valarray::value_type&); +template valarray operator> (const typename valarray::value_type&, + const valarray&); +template valarray operator<=(const valarray&, + const typename valarray::value_type&); +template valarray operator<=(const typename valarray::value_type&, + const valarray&); +template valarray operator>=(const valarray&, + const typename valarray::value_type&); +template valarray operator>=(const typename valarray::value_type&, + const valarray&); +template valarray operator&&(const valarray&, + const typename valarray::value_type&); +template valarray operator&&(const typename valarray::value_type&, + const valarray&); +template valarray operator||(const valarray&, + const typename valarray::value_type&); +template valarray operator||(const typename valarray::value_type&, + const valarray&); \end{itemdecl} \begin{itemdescr} @@ -7553,16 +7627,16 @@ template valarray asin (const valarray&); template valarray atan (const valarray&); template valarray atan2(const valarray&, const valarray&); -template valarray atan2(const valarray&, const T&); -template valarray atan2(const T&, const valarray&); +template valarray atan2(const valarray&, const typename valarray::value_type&); +template valarray atan2(const typename valarray::value_type&, const valarray&); template valarray cos (const valarray&); template valarray cosh (const valarray&); template valarray exp (const valarray&); template valarray log (const valarray&); template valarray log10(const valarray&); template valarray pow (const valarray&, const valarray&); -template valarray pow (const valarray&, const T&); -template valarray pow (const T&, const valarray&); +template valarray pow (const valarray&, const typename valarray::value_type&); +template valarray pow (const typename valarray::value_type&, const valarray&); template valarray sin (const valarray&); template valarray sinh (const valarray&); template valarray sqrt (const valarray&); From 432d9e90bd1b4c11f43cf90ddaa77cafc2840cf6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 Jun 2018 23:59:01 +0200 Subject: [PATCH 07/14] LWG3076 basic_string CTAD ambiguity --- source/strings.tex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/strings.tex b/source/strings.tex index 3b0cfd8e78..0712aceda4 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -1380,6 +1380,15 @@ of the array whose first element is pointed at by \tcode{s}, \tcode{size()} is equal to \tcode{traits::length(s)}, and \tcode{capacity()} is a value at least as large as \tcode{size()}. + +\pnum +\remarks +Shall not participate in overload resolution +if \tcode{Allocator} is a type +that does not qualify as an allocator\iref{container.requirements.general}. +\begin{note} +This affects class template argument deduction. +\end{note} \end{itemdescr} \indexlibrary{\idxcode{basic_string}!constructor}% @@ -1404,6 +1413,15 @@ of \tcode{n} elements, each storing the initial value \tcode{c}, \tcode{size()} is equal to \tcode{n}, and \tcode{capacity()} is a value at least as large as \tcode{size()}. + +\pnum +\remarks +Shall not participate in overload resolution +if \tcode{Allocator} is a type +that does not qualify as an allocator\iref{container.requirements.general}. +\begin{note} +This affects class template argument deduction. +\end{note} \end{itemdescr} \indexlibrary{\idxcode{basic_string}!constructor}% From 80bb1c423fd276f888e978d885ead8be076a8034 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 00:02:21 +0200 Subject: [PATCH 08/14] LWG3079 LWG 2935 forgot to fix the existing_p overloads of create_directory --- source/iostreams.tex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index eb0aff6a57..19fedae598 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -14800,11 +14800,11 @@ \begin{itemdescr} \pnum -\effects Establishes the postcondition by attempting to create the +\effects Creates the directory \tcode{p} resolves to, with attributes copied from directory \tcode{existing_p}. The set of attributes - copied is operating system dependent. Creation failure because \tcode{p} resolves to an existing directory shall not be - treated as an error. + copied is operating system dependent. + Creation failure because \tcode{p} already exists is not an error. \begin{note} For POSIX-based operating systems, the attributes are those copied by native API \tcode{stat(existing_p.c_str(), \&attributes_stat)} followed by \tcode{mkdir(p.c_str(), attributes_stat.st_mode)}. For @@ -14812,9 +14812,6 @@ API \tcode{CreateDirectoryExW(existing_p.c_str(), p.c_str(), 0)}. \end{note} -\pnum -\postconditions \tcode{is_directory(p)}. - \pnum \returns \tcode{true} if a new directory was created, otherwise \tcode{false}. The signature with argument \tcode{ec} returns \tcode{false} if an error occurs. From 9c2e1104d69f2950c35831c1e970abe9d4fe65ae Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 08:36:57 +0200 Subject: [PATCH 09/14] LWG3080 Floating point from_chars pattern specification breaks round-tripping --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 62f2bed8d4..8cdc238d66 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -29340,7 +29340,7 @@ except that \begin{itemize} \item -the only sign that may appear is \tcode{'-'}; +the sign \tcode{'+'} may only appear in the exponent part; \item if \tcode{fmt} has \tcode{chars_format::scientific} set but not \tcode{chars_format::fixed}, From 65f8389c7db89c2eba9c04ec74f99bca6f857942 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 08:39:39 +0200 Subject: [PATCH 10/14] LWG3083 What should ios::iword(-1) do? --- source/iostreams.tex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/iostreams.tex b/source/iostreams.tex index 19fedae598..dab7537d98 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1436,6 +1436,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\requires +\tcode{idx} is a value obtained by a call to \tcode{xalloc}. + \pnum \effects If \tcode{iarray} is a null pointer, allocates an array of @@ -1482,6 +1486,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\requires +\tcode{idx} is a value obtained by a call to \tcode{xalloc}. + \pnum \effects If \tcode{parray} is a null pointer, allocates an array of From f6102d07da4699493eac7aba0337c93514109217 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 08:43:44 +0200 Subject: [PATCH 11/14] LWG3094 [time.duration.io]p4 makes surprising claims about encoding --- source/utilities.tex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 8cdc238d66..66715b0410 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19528,9 +19528,10 @@ which are converted to arrays of \tcode{charT} using a decimal conversion with no leading zeroes. \pnum -For streams where \tcode{charT} has an 8-bit representation, -\tcode{"\textmu{}s"} should be encoded as UTF-8. Otherwise UTF-16 or UTF-32 is encouraged. -The implementation may substitute other encodings, including \tcode{"us"}. +If \tcode{Period::type} is \tcode{micro}, +but the character U+00B5 cannot be represented in +the encoding used for \tcode{charT}, +the unit suffix \tcode{"us"} is used instead of \tcode{"\textmu{}s"}. \pnum \returns \tcode{os}. From ae19c8942f25e9318771855080b31f329db24961 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 08:46:14 +0200 Subject: [PATCH 12/14] LWG3100 Unnecessary and confusing "empty span" wording --- source/containers.tex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index a8a017768d..92ec4c7e1c 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -9854,10 +9854,6 @@ constexpr span() noexcept; \end{itemdecl} \begin{itemdescr} -\pnum -\effects -Constructs an empty \tcode{span}. - \pnum \postconditions \tcode{size() == 0 \&\& data() == nullptr}. @@ -9881,12 +9877,12 @@ \pnum \effects Constructs a \tcode{span} that is a view over the range \range{ptr}{ptr + count}. -If \tcode{count} is 0 then an empty span is constructed. \pnum \postconditions \tcode{size() == count \&\& data() == ptr}. +\pnum \throws Nothing. \end{itemdescr} @@ -9905,7 +9901,6 @@ \pnum \effects Constructs a span that is a view over the range \range{first}{last}. -If \tcode{last - first == 0} then an empty \tcode{span} is constructed. \pnum \postconditions From aa3ef9b05575cc397016379652c7a7920e104d52 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 08:49:23 +0200 Subject: [PATCH 13/14] LWG3102 Clarify span iterator and const_iterator behavior --- source/containers.tex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 92ec4c7e1c..596b2e194d 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -9750,7 +9750,12 @@ the program is ill-formed. \pnum -The iterator type for span is a random access iterator and a contiguous iterator. +The iterator types \tcode{span::iterator} and \tcode{span::const_iterator} are +random access iterators\iref{random.access.iterators}, +contiguous iterators\iref{iterator.requirements.general}, and +constexpr iterators\iref{iterator.requirements.general}. +All requirements on container iterators\iref{container.requirements} apply to +\tcode{span::iterator} and \tcode{span::const_iterator} as well. \pnum All member functions of \tcode{span} have constant time complexity. From e33f7fa64098ca1e01e4efce2d2a00ff33c304b7 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 16 Jun 2018 09:54:03 +0200 Subject: [PATCH 14/14] LWG3104 Fixing duration division --- source/utilities.tex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 66715b0410..673a7d1a09 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19042,8 +19042,8 @@ \rSec3[time.duration.nonmember]{\tcode{duration} non-member arithmetic} \pnum -In the function descriptions that follow, \tcode{CD} represents the return type -of the function. +In the function descriptions that follow, unless stated otherwise, +let \tcode{CD} represent the return type of the function. \indexlibrary{\idxcode{common_type}}% \begin{itemdecl} @@ -19126,6 +19126,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +Let \tcode{CD} be +\tcode{common_type_t, duration>}. + \pnum \returns \tcode{CD(lhs).count() / CD(rhs).count()}. \end{itemdescr}