Skip to content
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

P1206R7 Conversions From Ranges To Containers #2806

Merged
merged 38 commits into from
Aug 9, 2022

Commits on Jun 20, 2022

  1. P1206R7 Conversions From Ranges To Containers

    `<ranges>`: Implement `ranges::to`, guarded by `__cpp_lib_ranges_to_container`.
    
    The following are all guarded  by `__cpp_lib_containers_ranges`:
    `<xmemory>`: Generalize `_Uninitialized_copy` to iterator+sentinel ranges; add `_Uninitialized_copy_n` for counted ranges. Implement `from_range_t`, `from_range`, and exposition-only helper concepts / type aliases.
    `<xutility>`: Promote `_Get_final_iterator_unwrapped` here from `<algorithm>`. Add `_Copy_memmove_n` (`_Copy_n_unchecked`), similar to `_Copy_memmove` (resp. `_Copy_unchecked`) but for counted ranges. Generalize `_Iter_copy_cat` to `_Sent_copy_cat`.
    `<memory>`: Use `_Copy_memmove_n` (see `<xutility>`) as appropriate.
    
    `<yvals_core.h>`: `_HAS_CXX23` controls P1206R7, define `__cpp_lib_containers_ranges` and `__cpp_lib_ranges_to_container`.
    
    `<deque>`: Implement `from_range_t` constructor(s) and corresponding deduction guide(s), `prepend_range`, `append_range`, `assign_range`, and `insert_range`.
    `<forward_list>`: Implement `from_range_t` constructor(s) and corresponding deduction guide(s), `prepend_range`, `assign_range`, and `insert_range_after`.
    `<list>`: Implement `from_range_t` constructor(s) and corresponding deduction guide(s), `prepend_range`, `append_range`, `assign_range`, and `insert_range`.
    `<map>` and `<set>`: For both `map`, `multimap`, `set`, and `multiset`, implement `from_range_t` constructor(s) and corresponding deduction guide(s). (Inherit `insert_range` from `_Tree`.)
    `<queue>`: For both `queue` and `priority_queue`, implement `from_range_t` constructor(s) and corresponding deduction guide(s), and `push_range`. (I've speculatively implemented `priority_queue::push_range` by calling `append_range` on the container per the resolution I've proposed for an LWG issue I submitted specifically to allow implementation via `append_range`.)
    `<stack>`: Implement `from_range_t` constructor(s) and corresponding deduction guide(s), and `push_range`.
    `<unordered_map>` and `<unordered_set>`: For both `unordered_map`, `unordered_multimap`, `unordered_set`, and `unordered_multiset`, implement `from_range_t` constructor(s) and corresponding deduction guide(s). (Inherit `insert_range` from `_Hash`.)
    `<vector>`: For both `vector` and `vector<bool>`, implement `from_range_t` constructor(s) and corresponding deduction guide(s), `append_range`, `assign_range`, and `insert_range`.
    `<xstring>`: For both `basic_string`, implement `from_range_t` constructor(s) and corresponding deduction guide(s), `append_range`, `assign_range`, `insert_range`, and `replace_with_range`.
    
    Test both new feature-test macros in `tests/std/tests/VSO_0157762_feature_test_macros`.
    Test all new deduction guides in `tests/std/tests/P0433R2_deduction_guides`.
    Test `_Copy_n_unchecked` in `tests/std/tests/P0784R7_library_machinery`.
    Add new t`P1206R7_{container}_{operation}` "range algorithm"-style tests for each new container (or container adapter) member function.
    Add new `P1206R7_from_range` test for `from_range` and `from_range_t`.
    Add new `P1206R7_ranges_to` test for `ranges::to`.
    
    Fixes microsoft#2532.
    CaseyCarter committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    a47b6d0 View commit details
    Browse the repository at this point in the history
  2. WIP

    CaseyCarter committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    a62fe8b View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2022

  1. Fixes

    CaseyCarter committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    4e59216 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2cb4fe9 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2022

  1. Configuration menu
    Copy the full SHA
    b5d02f4 View commit details
    Browse the repository at this point in the history
  2. factor commonality from forward_list::insert_range_after and ::insert…

    …_after(pos, first, last)
    CaseyCarter committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    5fae89b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    593e9a1 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2022

  1. miscco's review comments

    CaseyCarter committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    3b687e8 View commit details
    Browse the repository at this point in the history
  2. STL's review comments

    CaseyCarter committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    ccf85f4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b2a0262 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e75816a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3e6b68f View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2022

  1. Configuration menu
    Copy the full SHA
    29feac1 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2022

  1. Review comments

    CaseyCarter committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    073cc1a View commit details
    Browse the repository at this point in the history
  2. Revert clang-format noise

    CaseyCarter committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    06614a3 View commit details
    Browse the repository at this point in the history
  3. clang-format

    CaseyCarter committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    56eadd0 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Nicole's review comments

    CaseyCarter committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    1612f7b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    412e87d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    baa2afa View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2022

  1. Configuration menu
    Copy the full SHA
    e213a64 View commit details
    Browse the repository at this point in the history
  2. Fix comment typo.

    StephanTLavavej committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    148de4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    748e8fd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6eafabd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cb3b81d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d05cbd8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8ffc780 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bb956af View commit details
    Browse the repository at this point in the history
  9. Qualify _RANGES to.

    StephanTLavavej committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    7641514 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d424e80 View commit details
    Browse the repository at this point in the history
  11. Fix comments.

    StephanTLavavej committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    7883bd4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    371deba View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b983211 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e9c4a4e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    b9d8186 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a4932c5 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    5582f29 View commit details
    Browse the repository at this point in the history
  18. Chack construction from const from_range_t& instead of from_range_t

    ... per resolution of just-submitted LWG issue.
    CaseyCarter committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    4c9dc79 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2022

  1. Configuration menu
    Copy the full SHA
    d2cc9ed View commit details
    Browse the repository at this point in the history