-
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
Ranges <range> machinery #82
Conversation
Your description says "Annotate P0896R4 as partially implemented in the "_HAS_CXX20 indirect" section of <yvals_core.h>." but you're actually coalescing that section away. Also, consider hyperlinking P1474R1 in the description. Otherwise, looks good to me. |
* Implements a selection of support machinery in `std::ranges` and adds the `<ranges>` header. Primarily consists of the range access customization point objects: * `ranges::begin` * `ranges::end` * `ranges::cbegin` * `ranges::cend` * `ranges::rbegin` * `ranges::rend` * `ranges::crbegin` * `ranges::crend` * `ranges::size` * `ranges::empty` * `ranges::data` * `ranges::cdata` and range concepts: * `ranges::range` * `ranges::output_range` * `ranges::input_range` * `ranges::forward_range` * `ranges::bidirectional_range` * `ranges::random_access_range` * `ranges::contiguous_range` * `ranges::sized_range` * `ranges::view` * `ranges::common_range` and the associated type aliases: * `ranges::iterator_t` * `ranges::sentinel_t` * `ranges::range_value_t` * `ranges::range_reference_t` * `ranges::range_difference_t` * `ranges::range_rvalue_reference_t` * Adds `<ranges>` - which is mostly empty since the support machinery is defined in `<xutility>` so as to be visible to `<algorithm>` * Annotates [P0896R4](https://wg21.link/p0896r4) as partially implemented in the "`_HAS_CXX20` directly controls" section of `<yvals_core.h>`. * Touches `<regex>`, `<set>`, and `<unordered_set>` to add partial specializations of `ranges::enable_view` for `match_results` and `(unordered_)?multi?set` as mandated by the WD to override the heuristic. * Partially implements [P1474R1 "Helpful pointers for `ContiguousIterator`"](https://wg21.link/p1474r1): * Push `pointer_traits` from `<xmemory>` and `to_address` from `<memory>` up into `<xutility>` * Add `to_address` expression requirement to `contiguous_iterator` concept, and update `P0896R4_ranges_iterator_machinery` appropriately * Implement the changes to `ranges::data` (but not `view_interface` since it isn't yet implemented) * Drive-by: * Simplify the definition of `pointer_traits::_Reftype` by eschewing `add_lvalue_reference_t`. * Strengthen `reverse_iterator`'s constructors and `make_reverse_iterator` so `ranges::rbegin` and `ranges::rend` can be `noexcept` in more cases * Since we're using `_Rng` as the template parameter name for models of `std::ranges::range`, rename a local variable `_Rng` to `_Generator` in `<random>`
Corrected.
I've hyperlinked both P1474R1 and P0896R4. (And updated both the actual commit log and the description above.) |
C4180 "qualifier applied to function type has no meaning; ignored" is emitted from `std::remove_reference<T>` when `T` is a function type or reference to such after applying the changes in #82. We could suppress it locally, but the warning is extremely low-value for the STL in general so let's simply suppress it globally.
I experimented with different methods of preparing the dual checkin PR, and chose the wrong one.
This is a port of Microsoft-internal PR 200667. [This info is a convenience for internal reviewers, it is NOT part of the commit log.]
Ranges machinery
Implements a selection of support machinery in
std::ranges
and adds the<ranges>
header. Primarily consists of the range access customization point objects:ranges::begin
ranges::end
ranges::cbegin
ranges::cend
ranges::rbegin
ranges::rend
ranges::crbegin
ranges::crend
ranges::size
ranges::empty
ranges::data
ranges::cdata
and range concepts:
ranges::range
ranges::output_range
ranges::input_range
ranges::forward_range
ranges::bidirectional_range
ranges::random_access_range
ranges::contiguous_range
ranges::sized_range
ranges::view
ranges::common_range
and the associated type aliases:
ranges::iterator_t
ranges::sentinel_t
ranges::range_value_t
ranges::range_reference_t
ranges::range_difference_t
ranges::range_rvalue_reference_t
Adds
<ranges>
- which is mostly empty since the support machinery is defined in<xutility>
so as to be visible to<algorithm>
Annotates P0896R4 as partially implemented in the "
_HAS_CXX20
directly controls" section of<yvals_core.h>
.Touches
<regex>
,<set>
, and<unordered_set>
to add partial specializations ofranges::enable_view
formatch_results
and(unordered_)?multi?set
as mandated by the WD to override the heuristic.Partially implements P1474R1 "Helpful pointers for
ContiguousIterator
":pointer_traits
from<xmemory>
andto_address
from<memory>
up into<xutility>
to_address
expression requirement tocontiguous_iterator
concept, and updateP0896R4_ranges_iterator_machinery
appropriatelyranges::data
(but notview_interface
since it isn't yet implemented)Drive-by:
pointer_traits::_Reftype
by eschewingadd_lvalue_reference_t
.reverse_iterator
's constructors andmake_reverse_iterator
soranges::rbegin
andranges::rend
can benoexcept
in more cases_Rng
as the template parameter name for models ofstd::ranges::range
, rename a local variable_Rng
to_Generator
in<random>