Repository navigation
Implement LWG-3660 for iterator_traits::pointer - #2549
Conversation
LWG-3660 "`iterator_traits::pointer` should conform to [iterator.traits]" requires a tweak to iterator_traits so it always agrees with `operator->()`.
iterator_traits::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 |
||
|
requires _Has_member_arrow |
||
| 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.
There was a problem hiding this comment.
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::pointer should 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.