Skip to content

[coro.generator.class] Name the generator's second template parameter Val? #6451

Closed
@hewillk

Description

@hewillk
Contributor

The current synopsis of std::generator is:

namespace std {
  template<class Ref, class V = void, class Allocator = void>
  class generator : public ranges::view_interface<generator<Ref, V, Allocator>> {
  // ...

When I first saw the naming of the second template parameter, I didn't quite understand what the V here was referring to and it seemed to be just an abbreviation for void. After I looked at it a few more times, I finally realized that it is actually the corresponding value type relative to the first template parameter Ref.

The class V = void here seems to be so simplified that it even made me misunderstand that it is just a common template name like U and has no meaning. It may be more friendly to change it to class Val = void.

Comments are welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @hewillk

      Issue actions

        [coro.generator.class] Name the generator's second template parameter Val? · Issue #6451 · cplusplus/draft