-
Notifications
You must be signed in to change notification settings - Fork 1.6k
P2278R4: cbegin should always return a constant iterator ("Ranges" and "Span" sections)
#3187
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
Conversation
…ng in `<ranges>`
* Mark `_Possibly_const_range` as `noexcept` * Mark `_Possibly_const_range` and `_As_const_pointer` as `_NODISCARD` * Use `declval<T&>` (instead of `declval<T>`) inside of CPOs' template decl * Add workaround in `_Possibly_const_range` for yet (possibly) unreported MSVC error
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment was marked as resolved.
This comment was marked as resolved.
strega-nil-ms
left a comment
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.
very minor request, otherwise this looks great!
…t_cast` (as @strega-nil-ms suggested)
strega-nil-ms
left a comment
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.
Thanks for all your hard work!!!
|
Thanks, this is awesome, with very thorough test coverage! 😻 I've pushed small commits to fix |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for implementing another big part of this feature! 😻 📈 🚀 |
Towards #2918 - "
cbeginshould always return a constant iterator".view_interface::cbeginis underconstrained",const_sentinel_tis missing".clang-format [off/on]comments aroundview_interface,clang-format [off/on]comments around updated CPOs,<ranges>header (near new type aliases).range_algorithm_support.hppto detect membercbeginandcendfunctions,P0896R4_ranges_range_machinery\test.cppso it would not fail with updated CPOs,P0896R4_ranges_subrange\test.cppto test new members ofview_interface.cbeginshould always return a constant iterator ("Ranges" and "Span" sections) #3187 (comment)):Tests
std/containers/views/views.span/types.pass.cppstd/ranges/range.access/begin.pass.cppstd/ranges/range.access/data.pass.cppstd/ranges/range.access/end.pass.cppstd/ranges/range.access/rbegin.pass.cppstd/ranges/range.access/rend.pass.cppAdded workaround inChangedpossibly-const-rangefor MSVC bug DevCom-10187107 (repro: https://godbolt.org/z/d3GhhxTqT).possibly-const-rangeto usestd::as_constinstead ofconst_cast(as @strega-nil-ms suggested in P2278R4:cbeginshould always return a constant iterator ("Ranges" and "Span" sections) #3187 (comment)).Details
<span>header,input_iteratorconcept (soconstant_rangecould work),typenametoclassin template declarations in tests from P2278R4:cbeginshould always return a constant iterator ("Iterators" section only) #3043,yvals_corecomment tomissing views::as_const.