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

[rand.req.adapt] Fix syntax error #1194

Merged
merged 1 commit into from Dec 8, 2016

Conversation

jlaire
Copy link

@jlaire jlaire commented Dec 8, 2016

The void return type in the constructor is clearly an error, and I think adding A:: to the member functions is good for clarity.

@@ -2143,7 +2143,7 @@
\end{itemdescr}

\begin{itemdecl}
void seed();
void A::seed();
Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Author

@jlaire jlaire Dec 8, 2016

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.

Copy link
Contributor

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.

Copy link
Author

@jlaire jlaire Dec 8, 2016

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.

Copy link
Contributor

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.

@jwakely jwakely merged commit faecbe8 into cplusplus:master Dec 8, 2016
@jlaire jlaire deleted the fix-adaptor-requirements branch December 8, 2016 15:22
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

Successfully merging this pull request may close these issues.

None yet

3 participants