Skip to content

Commit

Permalink
Apply P0663R0 PR for 330: Argument deduction constraints are specifie…
Browse files Browse the repository at this point in the history
…d incorrectly

Fixes #330.
  • Loading branch information
CaseyCarter committed Jul 18, 2017
1 parent dad8498 commit 3c29d7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
25 changes: 13 additions & 12 deletions iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@
requires(I i) {
typename difference_type_t<I>;
requires SignedIntegral<difference_type_t<I>>;
{ ++i } -> Same<I&>; // not required to be equality preserving
{ ++i } -> Same<I>&; // not required to be equality preserving
i++; // not required to be equality preserving
};
\end{codeblock}
Expand Down Expand Up @@ -1075,7 +1075,7 @@
Regular<I> &&
WeaklyIncrementable<I> &&
requires(I i) {
{ i++ } -> Same<I>;
{ i++ } -> Same<I>&&;
};
\end{codeblock}

Expand Down Expand Up @@ -1172,8 +1172,8 @@
Sentinel<S, I> &&
!disable_sized_sentinel<remove_cv_t<S>, remove_cv_t<I>> &&
requires(const I& i, const S& s) {
{ s - i } -> Same<difference_type_t<I>>;
{ i - s } -> Same<difference_type_t<I>>;
{ s - i } -> Same<difference_type_t<I>>&&;
{ i - s } -> Same<difference_type_t<I>>&&;
};
\end{itemdecl}

Expand Down Expand Up @@ -1331,8 +1331,8 @@
ForwardIterator<I> &&
DerivedFrom<iterator_category_t<I>, bidirectional_iterator_tag> &&
requires(I i) {
{ @\dcr@i } -> Same<I&>;
{ i@\dcr@ } -> Same<I>;
{ --i } -> Same<I>&;
{ i-- } -> Same<I>&&;
};
\end{codeblock}

Expand Down Expand Up @@ -1372,12 +1372,13 @@
StrictTotallyOrdered<I> &&
SizedSentinel<I, I> &&
requires(I i, const I j, const difference_type_t<I> n) {
{ i += n } -> Same<I&>;
{ j + n } -> Same<I>;
{ n + j } -> Same<I>;
{ i -= n } -> Same<I&>;
{ j - n } -> Same<I>;
{ j[n] } -> Same<reference_t<I>>;
{ i += n } -> Same<I>&;
{ j + n } -> Same<I>&&;
{ n + j } -> Same<I>&&;
{ i -= n } -> Same<I>&;
{ j - n } -> Same<I>&&;
j[n];
requires Same<decltype(j[n]), reference_t<I>>;
};
\end{codeblock}

Expand Down
9 changes: 5 additions & 4 deletions numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
namespace std { namespace experimental { namespace ranges { inline namespace v1 {
template <class G>
concept bool UniformRandomNumberGenerator =
requires(G g) {
{ g() } -> UnsignedIntegral; // not required to be equality preserving
{ G::min() } -> Same<result_of_t<G&()>>;
{ G::max() } -> Same<result_of_t<G&()>>;
Invocable<G&> &&
UnsignedIntegral<result_of_t<G&()>> &&
requires {
{ G::min() } -> Same<result_of_t<G&()>>&&;
{ G::max() } -> Same<result_of_t<G&()>>&&;
};
}}}}
\end{codeblock}
Expand Down

0 comments on commit 3c29d7b

Please sign in to comment.