So, for a while I used ...
using namespace::std;
and recently I realized that there should be
using namespace std;
Can someone explain to me why I worked, and how it differs from the correct way to declare the use of a specific namespace?
The first version works because the compiler sees it as
using namespace ::std; // Notice space^
It just tells the compiler to look for the std in the global scope.
std
The scope operator :: without any left parts is the same as the global scope.
::
Source: https://habr.com/ru/post/1487515/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1487510/how-do-you-force-vs-to-make-you-handle-exceptions&usg=ALkJrhjL1yCFUtG4Iol8XAYIw0vMROS0ewWhy does sbt do permission for all dependencies when only one has changed? - scalaspeed up replacing NaNs with a last value other than Nan - optimizationValidating IntelliJ IDEA JSP - intellij-ideaWIX Bundle "Could not open this installation package." - wixSamsung Glaxy S4 users report that the BOOT_COMPLETED receiver is not working? - androidBoot receiver not working for my Samsung GT-S7852 - androidLinking libraries without links breaks my program - c ++GS file location in local / Dev AppEngine - google-app-engineInvalid DoubleClick ad request for publishers with AdMob SDK - androidAll Articles