From a4413633ec858f5cd3c12750409e5aaf75c3fae4 Mon Sep 17 00:00:00 2001 From: Daniel Cheng Date: Wed, 27 Jan 2021 15:59:35 -0800 Subject: [PATCH] Update C++ style guide. Minor formatting and wording fixes. --- cppguide.html | 124 ++++++++++++++++++++++++++------------------------ 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/cppguide.html b/cppguide.html index b90d89890..1997a10f8 100644 --- a/cppguide.html +++ b/cppguide.html @@ -343,8 +343,8 @@

Forward Declarations

-Try to avoid forward declarations of entities -defined in another project. +

Try to avoid forward declarations of entities +defined in another project.

Inline Functions

@@ -512,8 +512,7 @@

Namespaces

its path. Do not use using-directives (e.g., using namespace foo). Do not use inline namespaces. For unnamed namespaces, see -Unnamed Namespaces and -Static Variables. +Internal Linkage.

Namespaces subdivide the global scope @@ -674,13 +673,13 @@

Namespaces

  • Do not use inline namespaces.
  • -

    Unnamed Namespaces and Static -Variables

    + +

    Internal Linkage

    When definitions in a .cc file do not need to be -referenced outside that file, place them in an unnamed -namespace or declare them static. Do not use either -of these constructs in .h files. +referenced outside that file, give them internal linkage by placing +them in an unnamed namespace or declaring them static. +Do not use either of these constructs in .h files.

    All declarations can be given internal linkage by placing them in unnamed @@ -733,7 +732,7 @@

    Nonmember, Static Member

    If you define a nonmember function and it is only needed in its .cc file, use -internal linkage to limit +internal linkage to limit its scope.

    Local Variables

    @@ -1366,8 +1365,8 @@

    Copyable and Movable Types

    }; -

    These declarations/deletions can be omitted only if they are obvious: -