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

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

Open
hewillk opened this issue Aug 10, 2023 · 0 comments
Open

Comments

@hewillk
Copy link
Contributor

hewillk commented Aug 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant