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

P2502R2 <generator>: Synchronous Coroutine Generator For Ranges #4953

Merged
merged 72 commits into from
Sep 19, 2024

Commits on Jan 26, 2024

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

Commits on Jan 31, 2024

  1. Configuration menu
    Copy the full SHA
    fb6a4cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95c294b View commit details
    Browse the repository at this point in the history
  3. Merge pull request microsoft#4354 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    9bb121c View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Merge branch 'main' into merge-generator

    Resolved conflict in yvals_core.h, removing all guards around `__cpp_lib_generator` except `_HAS_CXX23`.
    
    * `__cpp_lib_concepts` is now always available in C++20 and later.
    * `<generator>` doesn't care about `std::byte` now.
    * C1XX, Clang, and EDG all define `__cpp_impl_coroutine` in C++20 and later, which wasn't the case earlier.
    StephanTLavavej committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    7710f6c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    12621be View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    53bf3a4 View commit details
    Browse the repository at this point in the history
  4. Update <generator>'s _HAS_CXX23 guard and message.

    Also add a missing semicolon - this emits a `_Pragma`.
    StephanTLavavej committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    84a6efe View commit details
    Browse the repository at this point in the history
  5. Work around VSO-1951821 by skipping stateful_alloc coverage for EDG.

    VSO-1951821 "EDG instantiates the wrong overload of `promise_type::operator new` for `generator` machinery"
    StephanTLavavej committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    f7e6bf1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e432c39 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d2aa714 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    af01b63 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Merge pull request microsoft#4370 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    5d949f1 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2024

  1. Configuration menu
    Copy the full SHA
    553c0c5 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4398 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    6bfb4ee View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

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

Commits on Mar 13, 2024

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

Commits on Mar 16, 2024

  1. Configuration menu
    Copy the full SHA
    dde15f8 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4484 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Mar 16, 2024
    Configuration menu
    Copy the full SHA
    ac3369a View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2024

  1. <generator>: Test generator::promise_type (microsoft#4534)

    Co-authored-by: Stephan T. Lavavej <[email protected]>
    JMazurkiewicz and StephanTLavavej committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    7f04044 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

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

Commits on Apr 12, 2024

  1. Merge branch 'main' into merge-generator

    Resolved a trivial merge conflict in `<ranges>` with the `inline constexpr` change for `_Compile_time_max_size`.
    StephanTLavavej committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    ffe74c1 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4582 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    6d55986 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. <generator>: Test generator::iterator (microsoft#4574)

    Co-authored-by: Casey Carter <[email protected]>
    JMazurkiewicz and CaseyCarter committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    7928387 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Configuration menu
    Copy the full SHA
    6fb9fa3 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4603 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    9efb2a5 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. Configuration menu
    Copy the full SHA
    c2b0579 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ad2c73 View commit details
    Browse the repository at this point in the history
  3. <generator>: An attempt to merge _Top and _Info (microsoft#4619)

    Co-authored-by: Stephan T. Lavavej <[email protected]>
    Co-authored-by: Alex Guteniev <[email protected]>
    3 people committed May 10, 2024
    Configuration menu
    Copy the full SHA
    0191658 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Configuration menu
    Copy the full SHA
    c76bb86 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4692 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed May 23, 2024
    Configuration menu
    Copy the full SHA
    c41dcde View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

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

Commits on Jun 18, 2024

  1. Configuration menu
    Copy the full SHA
    7e5c8c3 View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4737 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    9f8ea18 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. Merge branch 'main' into merge-generator

    Resolved an adjacent-add conflict in yvals_core.h.
    StephanTLavavej committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    5d4e965 View commit details
    Browse the repository at this point in the history
  2. _NODISCARD_FRIEND => _NODISCARD friend

    Resolves a stealth merge conflict with GH 4782.
    StephanTLavavej committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    156b2dd View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Merge pull request microsoft#4834 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    e07fc91 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

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

Commits on Aug 1, 2024

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

Commits on Aug 15, 2024

  1. Configuration menu
    Copy the full SHA
    b66813a View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4893 from StephanTLavavej/merge-generator

    Merge `main` to `feature/generator`
    StephanTLavavej committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    91aceaa View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Configuration menu
    Copy the full SHA
    6d2d6bf View commit details
    Browse the repository at this point in the history
  2. Merge pull request microsoft#4950 from StephanTLavavej/reformat-gener…

    …ator
    
    Merge `main` to `feature/generator`
    StephanTLavavej committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    d19a53a View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. Polish std::generator (microsoft#4952)

    This should complete the `generator` feature branch and get it ready to merge. There are very few product code changes here, it's mostly expanded test coverage with some cleanup and reorganization. There's also some documentation of the "stack of coroutines" and the memory layout of allocations that will make it easier for folks to get up to speed on how the code works under the covers.
    
    It's broken down nicely by commit for ease of review; I'll replicate the commit messages here as an overview. Comments without specific context refer to `P2502R2_generator` where most changes were made. The `P2502R2_generator_iterator` and `P2502R2_generator_promise` tests were already very nicely complete.
    
    * Update `generator` template argument mandates
      * Update citations to WG21-N4988
      * Reorder checks to specification order
      * Make `_RRef` more obviously reflect the wording for `RRef` in WG21-N4988 [coro.generator.class]/1.4.
    * Allocator testing updates
      * Simplify and correct `StatelessAlloc`
        * Deriving publicly from `std::allocator` not a great idea, as witnessed by the recent addition of `allocate_at_least`.
        * `deallocate` should be `noexcept` for a `Cpp17Allocator`.
        * We don't need to reimplement `std::allocator` when we can simply use it.
        * The domain of equality for `Cpp17Allocators` is an entire `rebind` family, i.e., `StatelessAlloc<T>` and `allocator_traits<StatelessAlloc<T>>::rebind_alloc<U>` must be comparable.
      * PascalCase `stateful_alloc` for consistency and move into the header with `StatelessAlloc`.
    * Promise test tweaks
      * "whose member `await_ready` returns `false`" in WG21-N4988 [coro.generator.promise]/11 implies the return type is exactly `bool`, not "convertible to `bool`". Update `test_yield_elements_of_range` accordingly.
      * Move non-portable size check from `P2502R2_generator` into `P2502R2_generator_promise`
    * Expand and complete `static_checks`: Implement a complete `generator` traits in the header to use in both `P2502R2_generator_iterator` and `P2502R2_generator`'s `static_checks`.
    * Create generic `test_one` template which takes a generator, a description of its static properties, and the expected result of piping the generator through a provided range adaptor. `test_one` validates the static properties with `static_checks`, and confirms the output is as expected.
    * Extract test cases for weird reference types (mutable lvalue and rvalue references) from `main` into new function `test_weird_reference_types`.
    * Several small tweaks:
      * It's no longer significant that `co_upto` wasn't an example in the proposal; strike the comment.
      * Enforce `co_upto`'s precondition so it's nicely documented.
      * Consistently prefer `same_as` to `is_same_v`.
      * Regroup calls to test cases in `main` topically and title each category.
    * Reorganize test code to agree with call order in `main`. [This is the largest individual commit; it is a pure reordering.]
    * All product code assertions now depend on `_CONTAINER_DEBUG_LEVEL`. These are all simple O(1) checks, there's no reason not to promote them from `_DEBUG` to `_CONTAINER_DEBUG_LEVEL`.
    * Clarify allocation mechanisms, including some fancy memory layout diagrams.
      * Rename `_Promise_allocator` to `_Coro_promise_allocator` to avoid any confusion with `_Promise`. Rename its template parameter `_Allocator` to `_Proto_allocator` to avoid confusion with the rebound allocator type `_Alloc`.
      * Expand `static_assert` message in `operator new`. If and when `_Coro_promise_allocator` is reused by other coroutine types we can worry about making the message more generic.
      * Extract block size computations.
    * `Element_awaiter` must direct-non-list-initialize its stored object, per WG21-N4988 [coro.generator.promise]/7.
    * Document the "stack of coroutine handles" in a code comment with another work of art.
    CaseyCarter committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    89283a6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb573d3 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. Configuration menu
    Copy the full SHA
    b61b7ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4d372ed View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6482abe View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2f9cf38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    483d091 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    402b5d8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6c957a2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    43ed77d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    bba8c2e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c4a4d6e View commit details
    Browse the repository at this point in the history
  11. Clarify comments

    CaseyCarter committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    9da3deb View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a4a6b55 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3ab2a88 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    215c774 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c16ccbb View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    124dc45 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    332e3a6 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1532f08 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    75144b6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    44658f2 View commit details
    Browse the repository at this point in the history
  21. Style: Attach brace.

    StephanTLavavej committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    8573013 View commit details
    Browse the repository at this point in the history
  22. Too many secrets.

    StephanTLavavej committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    586e6fa View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    61a1651 View commit details
    Browse the repository at this point in the history
  24. STL's product code review comments

    * `const`-ify members of awaitable objects that can be `const`.
    * Annotate that the iterator's `operator*` has a `/* strengthened */` _noexcept-specifier_.
    CaseyCarter committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    55516dd View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. STL's review comments

    Several minor nits, and I burned away all the unnecessary parts of "mutable rvalue reference type". Don't know where I was heading with it, but it never made it there.
    CaseyCarter committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    1f86f07 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cebe620 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

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