P2278R4: cbegin should always return a constant iterator ("Ranges" and "Span" sections)#3187
Merged
StephanTLavavej merged 21 commits intomicrosoft:mainfrom Nov 11, 2022
Merged
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
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
StephanTLavavej
requested changes
Oct 31, 2022
This comment was marked as resolved.
This comment was marked as resolved.
strega-nil-ms
suggested changes
Nov 1, 2022
Contributor
strega-nil-ms
left a comment
There was a problem hiding this comment.
very minor request, otherwise this looks great!
…t_cast` (as @strega-nil-ms suggested)
strega-nil-ms
approved these changes
Nov 2, 2022
Contributor
strega-nil-ms
left a comment
There was a problem hiding this comment.
Thanks for all your hard work!!!
StephanTLavavej
approved these changes
Nov 8, 2022
Member
|
Thanks, this is awesome, with very thorough test coverage! 😻 I've pushed small commits to fix |
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for implementing another big part of this feature! 😻 📈 🚀 |
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.