File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -860,23 +860,28 @@ your private interface remains private and undisturbed by outsiders.
860860 It's okay to put extra implementation methods in a public class itself. Just
861861 make them private (or protected) and all is well.
862862
863- Use Namespace Qualifiers to Implement Previously Declared Functions
864- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
863+ Use Namespace Qualifiers to Define Previously Declared Variables and Functions
864+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
865865
866- When providing an out-of-line implementation of a function in a source file, do
867- not open namespace blocks in the source file. Instead, use namespace qualifiers
868- to help ensure that your definition matches an existing declaration. Do this:
866+ When providing an out-of-line definition of a variable or a function in a source
867+ file, do not open namespace blocks in the source file. Instead, use namespace
868+ qualifiers to help ensure that your definition matches an existing declaration.
869+ Do this:
869870
870871.. code-block :: c++
871872
872873 // Foo.h
873874 namespace llvm {
875+ extern int FooVal;
874876 int foo(const char *s);
875877 }
876878
877879 // Foo.cpp
878880 #include "Foo.h"
879881 using namespace llvm;
882+
883+ int llvm::FooVal;
884+
880885 int llvm::foo(const char *s) {
881886 // ...
882887 }
You can’t perform that action at this time.
0 commit comments