Title
Redundant specification [for overload of yield_value]
Status
c++23
Section
[coro.generator.promise]
Submitter
US

Created on 2022-11-10.00:00:00 last changed 12 months ago

Messages

Date: 2022-11-17.00:42:33

Proposed resolution:

This wording is relative to N4917.

  1. Modify [coro.generator.promise] as indicated:

    template<ranges::input_range R, class Alloc>
      requires convertible_to<ranges::range_reference_t<R>, yielded>
        auto yield_value(ranges::elements_of<R, Alloc> r) noexcept;
    

    -13- Effects: Equivalent to: […]

    -14- Remarks: [Note 1: A yield-expression that calls this function has type void ([expr.yield]). end note]

Date: 2022-11-12.00:00:00

[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Immediate → WP. ]

Date: 2022-11-12.00:58:30

[ Kona 2022-11-11; Move to Immediate ]

Date: 2022-11-10.00:00:00

[ 2022-11-10 Casey provides wording ]

Date: 2022-11-10.18:18:08

This is in resolution of US 56-118 ([coro.generator.promise] Redundant specification).

[Paragraph 14] is redundant given [paragraphs] 13 and 12. Remove it.

Paragraphs 12 and 14 are identical: "Remarks: A yield-expression that calls this function has type void ([expr.yield])." Paragraph 13 states that the overload of yield_value that accepts ranges::elements_of for arbitrary ranges has "Effects: Equivalent to:" calling the overload of yield_value that accepts specializations of generator, which paragraph 12 specifies. Per [structure.specifications] paragraph 4, the former overload "inherits" the Remarks of paragraph 12 making paragraph 14 redundant.

LWG is concerned that the redundancy is not immediately obvious — it depends on an understanding of how await expressions function — so we'd like to preserve comment despite that we agree that it is normatively redundant.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-11-17 00:42:33adminsetmessages: + msg13100
2022-11-17 00:42:33adminsetstatus: immediate -> wp
2022-11-12 00:58:30adminsetmessages: + msg13028
2022-11-12 00:58:30adminsetstatus: new -> immediate
2022-11-10 17:58:00adminsetmessages: + msg12992
2022-11-10 17:58:00adminsetmessages: + msg12991
2022-11-10 00:00:00admincreate