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

Update C++ style guide. #787

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

zetafunction
Copy link
Contributor

  • Update caveats for thread_local usage, particularly around the risk of destruction order issues.
  • Provide explicit guidance for situations where bit_cast may be a better fit than reinterpret_cast.
  • Emphasize that kConstant-style naming can still be used for const automatic variables that are initialized at runtime, but only if the resulting variable has the same value with each evaluation (i.e. it does not depend on runtime inputs).
  • Clarify what sorts of details belong in file-level comments vs comments for individual abstractions.
  • Update TODO examples to reflect the preferred styling, from most preferred to least preferred.

These style guides are copies of Google's internal style guides to
assist developers working on Google owned and originated open source
projects. Changes should be made to the internal style guide first and
only then copied here.

Unsolicited pull requests will not be merged and are usually closed
without comment. If a PR points out a simple mistake — a typo, a broken
link, etc. — then the correction can be made internally and copied here
through the usual process.

Substantive changes to the style rules and suggested new rules should
not be submitted as a PR in this repository. Material changes must be
proposed, discussed, and approved on the internal forums first.

- Update caveats for `thread_local` usage, particularly around the risk
  of destruction order issues.
- Provide explicit guidance for situations where `bit_cast` may be a
  better fit than `reinterpret_cast`.
- Emphasize that kConstant-style naming can still be used for `const`
  automatic variables that are initialized at runtime, but only if the
  resulting variable has the same value with each evaluation (i.e. it
  does not depend on runtime inputs).
- Clarify what sorts of details belong in file-level comments vs
  comments for individual abstractions.
- Update TODO examples to reflect the preferred styling, from most
  preferred to least preferred.
@tituswinters tituswinters merged commit 718ea5d into google:gh-pages Aug 23, 2023
1 check passed
@tituswinters
Copy link
Contributor

Thanks!

@zetafunction zetafunction deleted the update-styleguide-2 branch August 23, 2023 18:23
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