Closed
Description
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
Labels
No labels
Activity
generator
's template parameterV
toVal
#7129