From 35bf00d333c1c30fa10962a69a5e08a5f8d5a77e Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 18 Jul 2017 13:55:19 -0700 Subject: [PATCH] Apply P0663R0 PR for 330: Argument deduction constraints are specified incorrectly Fixes #330. --- concepts.tex | 21 --------------------- iterators.tex | 25 +++++++++++++------------ numerics.tex | 9 +++++---- 3 files changed, 18 insertions(+), 37 deletions(-) diff --git a/concepts.tex b/concepts.tex index e75a75b0..38701b1a 100644 --- a/concepts.tex +++ b/concepts.tex @@ -483,20 +483,10 @@ \begin{itemdescr} \pnum -<<<<<<< HEAD Let \tcode{t} be an lvalue which refers to an object \tcode{o} such that \tcode{decltype((t))} is \tcode{T}, and \tcode{u} an expression such that \tcode{decltype((u))} is \tcode{U}. Let \tcode{u2} be a distinct object that is equal to \tcode{u}. \tcode{Assignable} is satisfied only if -======= -Let \tcode{t} be an lvalue of type \tcode{T}, and \tcode{R} be the -type \tcode{remove_reference_t}. If \tcode{U} is an lvalue reference -type, let \tcode{v} be an lvalue of type \tcode{R}; -otherwise, let \tcode{v} be an rvalue of type \tcode{R}. -Let \tcode{uu} be a distinct object of type \tcode{R} such that -\tcode{uu} is equal to \tcode{v}. -\tcode{Assignable} is satisfied only if ->>>>>>> issue_155 \begin{itemize} \item \tcode{addressof(t = u) == addressof(o)}. @@ -888,14 +878,8 @@ \begin{itemdescr} \pnum -<<<<<<< HEAD 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}. -======= -Let \tcode{U} be the type \tcode{remove_cv_t}, -\tcode{rv} be an rvalue of type \tcode{U}, -and \tcode{u2} be a distinct object of type \tcode{T} equal to \tcode{rv}. ->>>>>>> issue_155 \tcode{MoveConstructible} is satisfied only if \begin{itemize} @@ -922,13 +906,8 @@ \begin{itemdescr} \pnum -<<<<<<< HEAD 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}. -======= -Let \tcode{v} be an lvalue of type (possibly \tcode{const}) -\tcode{remove_cv_t} or an rvalue of type \tcode{const remove_cv_t}. ->>>>>>> issue_155 \tcode{CopyConstructible} is satisfied only if \begin{itemize} diff --git a/iterators.tex b/iterators.tex index ec2fa3ba..cbc8ad23 100644 --- a/iterators.tex +++ b/iterators.tex @@ -1034,7 +1034,7 @@ requires(I i) { typename difference_type_t; requires SignedIntegral>; - { ++i } -> Same; // not required to be equality preserving + { ++i } -> Same&; // not required to be equality preserving i++; // not required to be equality preserving }; \end{codeblock} @@ -1075,7 +1075,7 @@ Regular && WeaklyIncrementable && requires(I i) { - { i++ } -> Same; + { i++ } -> Same&&; }; \end{codeblock} @@ -1172,8 +1172,8 @@ Sentinel && !disable_sized_sentinel, remove_cv_t> && requires(const I& i, const S& s) { - { s - i } -> Same>; - { i - s } -> Same>; + { s - i } -> Same>&&; + { i - s } -> Same>&&; }; \end{itemdecl} @@ -1331,8 +1331,8 @@ ForwardIterator && DerivedFrom, bidirectional_iterator_tag> && requires(I i) { - { @\dcr@i } -> Same; - { i@\dcr@ } -> Same; + { --i } -> Same&; + { i-- } -> Same&&; }; \end{codeblock} @@ -1372,12 +1372,13 @@ StrictTotallyOrdered && SizedSentinel && requires(I i, const I j, const difference_type_t n) { - { i += n } -> Same; - { j + n } -> Same; - { n + j } -> Same; - { i -= n } -> Same; - { j - n } -> Same; - { j[n] } -> Same>; + { i += n } -> Same&; + { j + n } -> Same&&; + { n + j } -> Same&&; + { i -= n } -> Same&; + { j - n } -> Same&&; + j[n]; + requires Same>; }; \end{codeblock} diff --git a/numerics.tex b/numerics.tex index b5e33169..e828359f 100644 --- a/numerics.tex +++ b/numerics.tex @@ -22,10 +22,11 @@ namespace std { namespace experimental { namespace ranges { inline namespace v1 { template concept bool UniformRandomNumberGenerator = - requires(G g) { - { g() } -> UnsignedIntegral; // not required to be equality preserving - { G::min() } -> Same>; - { G::max() } -> Same>; + Invocable && + UnsignedIntegral> && + requires { + { G::min() } -> Same>&&; + { G::max() } -> Same>&&; }; }}}} \end{codeblock}