You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The current synopsis of
std::generator
is: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 forvoid
. 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 parameterRef
.The
class V = void
here seems to be so simplified that it even made me misunderstand that it is just a common template name likeU
and has no meaning. It may be more friendly to change it toclass Val = void
.Comments are welcome.
The text was updated successfully, but these errors were encountered: