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
[rand.req.adapt] Fix syntax error #1194
Conversation
@@ -2143,7 +2143,7 @@ | |||
\end{itemdescr} | |||
|
|||
\begin{itemdecl} | |||
void seed(); | |||
void A::seed(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird. In most itemdecls we never say the class name. This "random" business is very idiosyncratic, though. But I'd call this change a step backwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is weird, but the constructors have A::A
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this pattern of listing requirements by declaring the member functions elsewhere. Usually we have a list of expressions and required semantics, e.g. a.seed()
instead of void seed();
. The function templates are easier to spell by showing the declarations though.
I can drop this commit if it's not good and just remove the void
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuple
, pair
and vector
don't use this pattern.
Yeah, maybe drop this commit except the void
fix. Feel free to open an issue if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think tuple
, pair
and vector
are really comparable. They are standard types defined with a synopsis and a detailed description of each function like a lot of others.
This section lists "adapter requirements" that any type can meet, and is more similar to the iterator categories, Allocator requirements, etc., which we specify with a table of expressions that must be valid and have some required semantics. In fact the surrounding subclauses [rand.req.seedseq], [rand.req.urng], [rand.req.eng] and [rand.req.dist] all use this approach too. I have no idea why [rand.req.adapt] is different like this. For now I'll leave it alone, just removing the void
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. OK, let's revisit that at some point.
3503f99
to
5ab2394
Compare
The
void
return type in the constructor is clearly an error, and I think addingA::
to the member functions is good for clarity.