【问题标题】:How to distinguish between "using declaration" and "using directive" in C++?如何区分 C++ 中的“使用声明”和“使用指令”?
【发布时间】:2020-09-21 17:04:36
【问题描述】:

如何区分 C++ 中的“使用声明”和“使用指令”? “使用声明”和“使用指令”之间的主要区别是什么?有人可以通过举一些简单的例子来说明清楚吗?对于这个问题,我将不胜感激。

【问题讨论】:

标签: c++ c++11


【解决方案1】:

https://en.cppreference.com/w/cpp/keyword/using中的描述

命名空间使用指令和命名空间成员使用声明

using namespace std; // using-directive   
using std::string;   // using-declaration

【讨论】:

    猜你喜欢
    • 2013-04-15
    • 2018-06-29
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 1970-01-01
    • 1970-01-01
    • 2011-06-15
    相关资源
    最近更新 更多