Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After P0547R0, const-qualified iterator types are not Readable or Writable #339

Closed
ericniebler opened this issue Feb 28, 2017 · 3 comments
Closed

Comments

@ericniebler
Copy link
Owner

ericniebler commented Feb 28, 2017

Readable requires Movable. const-qualified types are not Movable after P0547R0. Ouch.

Proposed Resolution

Accept the revised wording in P0547R1.

@CaseyCarter CaseyCarter added the P1 label Feb 28, 2017
@ericniebler ericniebler changed the title After P0547, const-qualified iterator types are not Readable After P0547, const-qualified iterator types are not Readable or Writable Feb 28, 2017
@ericniebler
Copy link
Owner Author

ericniebler commented Feb 28, 2017

SUPERSEDED (...by incorporation into P0547R1)

Update section "Concept Readable" ([iterators.readable]) as follows (also includes part of the PR for #330):

template <class I>
concept bool Readable() {
- return Movable<I>() && DefaultConstructible<I>() &&
-   requires(const I& i) {
+ return requires {
    typename value_type_t<I>;
    typename reference_t<I>;
    typename rvalue_reference_t<I>;
-   { *i } -> Same<reference_t<I>>;
-   { ranges::iter_move(i) } -> Same<rvalue_reference_t<I>>;
  } &&
  CommonReference<reference_t<I>, value_type_t<I>&>() &&
  CommonReference<reference_t<I>, rvalue_reference_t<I>>() &&
  CommonReference<rvalue_reference_t<I>, const value_type_t<I>&>();
}

Update section "Concept Writable" ([iterators.writable]) as follows:

template <class Out, class T>
concept bool Writable() {
- return Movable<Out>() && DefaultConstructible<Out>() &&
-   requires(Out o, T&& t) {
+ return requires(Out& o, T&& t) {
    *o = std::forward<T>(t); // not required to be equality preserving
  };
}

@CaseyCarter for your review.

@CaseyCarter
Copy link
Collaborator

The requires expression in Readable no longer needs any parameters. (There's also something funky with the indentation, but the Editor can fix that.)

@ericniebler
Copy link
Owner Author

Fixed by P0547, LWG wants to see the paper again.

@ericniebler ericniebler added open and removed new labels Mar 4, 2017
CaseyCarter added a commit to microsoft/Range-V3-VS2015 that referenced this issue Mar 24, 2017
* Update Readable per ericniebler/stl2#339
* Don't require Readable-post-increment for WeakInputIterator, a la P0541
@CaseyCarter CaseyCarter changed the title After P0547, const-qualified iterator types are not Readable or Writable After P0547R0, const-qualified iterator types are not Readable or Writable Jul 7, 2017
@ericniebler ericniebler added ready and removed open labels Jul 12, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
CaseyCarter added a commit that referenced this issue Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants