File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11---
22title : " Namespaces (C++) | Microsoft Docs"
33ms.custom : " "
4- ms.date : " 11/04/2016 "
4+ ms.date : " 08/30/2017 "
55ms.reviewer : " "
66ms.suite : " "
77ms.technology :
@@ -66,7 +66,7 @@ ContosoData::Func(mgr);
6666 Use a using declaration to bring one identifier into scope:
6767
6868```cpp
69- using WidgetsUnlimited ::ObjectManager;
69+ using ContosoData ::ObjectManager;
7070ObjectManager mgr;
7171mgr.DoSomething();
7272
@@ -75,7 +75,8 @@ mgr.DoSomething();
7575 Use a using directive to bring everything in the namespace into scope:
7676
7777``` cpp
78- using namespace WidgetsUnlimited ;
78+ using namespace ContosoData ;
79+
7980ObjectManager mgr;
8081mgr.DoSomething();
8182Func (mgr);
@@ -104,15 +105,15 @@ namespace ContosoDataServer
104105}
105106```
106107
107- Function implementations in contosodata.cpp should use the fully qualified name, even if you place a using directive at the top of the file:
108+ Function implementations in contosodata.cpp should use the fully qualified name, even if you place a ` using ` directive at the top of the file:
108109
109110``` cpp
110111#include " contosodata.h"
111112using namespace ContosoDataServer ;
112113
113- void ContosoDataServer::Foo ()
114+ void ContosoDataServer::Foo () // use fully-qualified name here
114115{
115- //no qualification because using directive above
116+ // no qualification needed for Bar()
116117 Bar ();
117118}
118119
You can’t perform that action at this time.
0 commit comments