Implement LWG-3660 for iterator_traits<common_iterator>::pointer#2549
Implement LWG-3660 for iterator_traits<common_iterator>::pointer#2549StephanTLavavej merged 2 commits intomicrosoft:mainfrom
iterator_traits<common_iterator>::pointer#2549Conversation
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.
Mega-nitpick, not worth resetting testing, no change requested: The empty comment // (to force wrapping) is unnecessary in a clang-format off region.
|
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>::pointershould conform to [iterator.traits]" requires a tweak toiterator_traitsso it always agrees withoperator->().Also removes comments for LWG-3601 and LWG-3616 which have been voted into the Standard, see #2527.