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
How to specify small nested classes: struct/class, private members #5323
Comments
@jwakely, @CaseyCarter: LWG perspectives welcome! |
Tentatively, what would the rule for using
|
There are a ton of I think Library generally uses the rule that |
"No private members" is certainly a good first step. For purposes of the standard, some classes don't have any visible members, but they are containers or so and thus must have data members; they're just not shown. Those should be "class" as well. |
Editorial meeting opinion: This is not overly important, but we can certainly create and write down a rule. Based on the above, it should be something like "If it has invariants, it's a |
Added a wiki entry that recomends the above rule. No further action at this point, though cleanup PRs are welcome. |
We have a number of small, nested classes, mainly in the ranges library, which we currently variably specify with
class
andstruct
(e.g.outer-iterator
,value_type
). It might be helpful to pick one class key for all those cases.A related question is how we order exposition-only members: previously, they used to appear at the end of the class defintion, but the ranges additions have started placing them at the beginning. We should discuss whether we want to mandate any particular style, or if there's value in allowing discretion.
Finally, this is related to the discussion of how to style exposition-only members (#4702).
The text was updated successfully, but these errors were encountered: