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

Updated "Class declaration layout" style guideline #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rousskov
Copy link
Contributor

@rousskov rousskov commented Oct 6, 2023

Developers (mis)interpreted the previous version differently. This
version attempts to address known differences while avoiding areas
without consensus.

Also need to update how overridden methods are declared since Squid
started using C++11 "override" specifier.

Also synced with the recently added "No new globals" rule.

Developers (mis)interpreted the previous version differently. This
version attempts to address known differences while avoiding areas
without consensus.

Also need to update how overridden methods are declared since Squid
started using C++11 "override" specifier.

Also synced with the recently added "No new globals" rule.
... to the level of previous coverage (at least).
@rousskov
Copy link
Contributor Author

rousskov commented Oct 6, 2023

This PR is based on 2022 squid-dev RFC. The original RFC received Francesco's general support but not other comments. In this PR, I applied some polishing touches/updates and formatting changes to the original proposal.

The original RFC email points to squid-cache/squid#1067 (comment) discussion as the source of the "Developers (mis)interpreted the previous version differently" claim in the PR description.

Disclaimer: I am still unable to fully test wiki rendering locally (but am making slow progress towards finding a workaround).

@rousskov rousskov requested review from kinkie and yadij December 26, 2023 15:40

/* Bar API */
all methods overloaded from FooBar parent class
Foo(const char *, size_t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to also highlight how single-argument constructor should
normally be marked explicit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but not right here, IMHO, because a proper treatment of that rule of thumb requires more text/explanation (e.g., we do not want folks to start adding explicit constructors where no constructor is needed at all). We do not even spell out that rule of thumb anywhere (yet). This simple class illustration is meant to focus/depict an overall class layout, without function-specific distractions/complications.

Copy link
Contributor

@kinkie kinkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me, thanks for the clarifications

@rousskov
Copy link
Contributor Author

@yadij, this PR has been waiting for your review for about 10 months. Please review it (or cancel my review request).

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.

2 participants