-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement LWG-3660 for iterator_traits<common_iterator>::pointer
#2549
Conversation
LWG-3660 "`iterator_traits<common_iterator>::pointer` should conform to [iterator.traits]" requires a tweak to iterator_traits so it always agrees with `operator->()`.
iterator_traits<common_iterator>::pointer
I've updated this PR's title (and #2548) to include a short explanation of what the LWG issue is about. (They don't need to copy the issue's name exactly, just have a quick summary.) This makes it easier to read the Code Reviews project (so we don't have to memorize what each LWG issue number means) and will make it easier to read the commit history when this is eventually merged. |
// clang-format off | ||
template <class _Iter, class _Se> | ||
requires _Has_member_arrow<const common_iterator<_Iter, _Se>&> // | ||
struct _Common_iterator_pointer_type<_Iter, _Se> { | ||
// clang-format on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mega-nitpick, not worth resetting testing, no change requested: The empty comment //
(to force wrapping) is unnecessary in a clang-format off
region.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh.
Is it intended that |
I'm mirroring this to the MSVC-internal repo. Requesting or pushing changes is totally fine, but please notify me if that happens. |
It's certainly what the spec requires, although looking at it today I'm not sure why. Maybe I wanted to avoid unnecessary iterator copies? Maybe I thought doing so would make it easier to support move-only iterators? |
Thanks for fixing this |
LWG-3660 "
iterator_traits<common_iterator>::pointer
should conform to [iterator.traits]" requires a tweak toiterator_traits
so it always agrees withoperator->()
.Also removes comments for LWG-3601 and LWG-3616 which have been voted into the Standard, see #2527.