What's the scope of the “using” declaration in C++?

后端 未结 7 635
醉话见心
醉话见心 2020-12-07 19:45

I\'m using the \'using\' declaration in C++ to add std::string and std::vector to the local namespace (to save typing unnecessary \'std::\'s).

using std::str         


        
7条回答
  •  北海茫月
    2020-12-07 20:27

    That is correct. The scope is the module that uses the using declaration. If any header files that a module includes have using declarations, the scope of those declarations will be that module, as well as any other modules that include the same headers.

提交回复
热议问题