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

move_iterator::operator* should be defined in terms of iter_move #244

Closed
ericniebler opened this issue Oct 31, 2016 · 2 comments
Closed

Comments

@ericniebler
Copy link
Owner

ericniebler commented Oct 31, 2016

Proposed Resolution:

Change the synopsis of class move_iterator in [move.iterator]:

template <InputIterator I>
class move_iterator {
public:
  using iterator_type = I;
  using difference_type = difference_type_t<I>;
  using value_type = value_type_t<I>;
  using iterator_category = input_iterator_tag;
-  using reference = see below ;
+  using reference = rvalue_reference_t<I>;
  move_iterator();
  explicit move_iterator(I i);
  [...]
};

Delete paragraph 1:

- 1 Let R be reference_t<I>. If is_reference<R>::value is true, the template
-   specialization move_iterator<I> shall define the nested type named reference as a
-   synonym for remove_reference_t<R>&&, otherwise as a synonym for R.

Change the description of move_iterator::operator* in [move.iter.op.star] as follows:

- 1 Effects: Equivalent to static_cast<reference>(*current).
+ 1 Effects: Equivalent to: return iter_move(current);
@ericniebler
Copy link
Owner Author

We forgot that i[n] should be changed to return iter_move(i + n). Considering that the op* change was approved, I consider the corresponding change to op[] to be editorial/approved in principle. We should note the edit in the Editor's Report for Kona.

@ericniebler
Copy link
Owner Author

See e70a378.

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