Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1287

Comment by HolyBlackCat on I'm a little confused in namespaces in C++

$
0
0
using namespace is weird. It doesn't bring the target namespace to the current scope, rather it brings it to the common enclosing namespace of the current and target namespace, which in practice means it gets less priority than normal declarations (except when it causes a conflict with a global-namespace name, which is an error). using second::x behaves more like you'd expect (in your case it causes an error because it conflicts with int x;).

Viewing all articles
Browse latest Browse all 1287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>