summaryrefslogtreecommitdiffhomepage
path: root/c++.html.markdown
diff options
context:
space:
mode:
authorGeoff Liu <g@geoffliu.me>2015-08-28 11:48:38 -0600
committerGeoff Liu <g@geoffliu.me>2015-08-28 11:48:38 -0600
commit97b97408eab97fbe322df4266cda9ab2ed21fceb (patch)
tree25373ae075bbb3926acd3d2c5d8a7e3efee839e3 /c++.html.markdown
parent55735f8b6c3d16b239203f2c7d975a3bd818fab4 (diff)
Fix C++ namespace explanation
Diffstat (limited to 'c++.html.markdown')
-rw-r--r--c++.html.markdown7
1 files changed, 4 insertions, 3 deletions
diff --git a/c++.html.markdown b/c++.html.markdown
index ff2a98fd..883d3482 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -158,11 +158,12 @@ void foo()
int main()
{
- // Assume everything is from the namespace "Second"
- // unless otherwise specified.
+ // Includes all symbols from `namesapce Second` into the current scope. Note
+ // that simply `foo()` no longer works, since it is now ambiguous whether
+ // we're calling the `foo` in `namespace Second` or the top level.
using namespace Second;
- foo(); // prints "This is Second::foo"
+ Second::foo(); // prints "This is Second::foo"
First::Nested::foo(); // prints "This is First::Nested::foo"
::foo(); // prints "This is global foo"
}