我正在阅读mongo源码,阅读using ::std::mutex,但我不知道这是什么意思?
namespace stdx {
using ::std::mutex; // NOLINT
using ::std::timed_mutex; // NOLINT
using ::std::recursive_mutex; // NOLINT
using ::std::adopt_lock_t; // NOLINT
using ::std::defer_lock_t; // NOLINT
using ::std::try_to_lock_t; // NOLINT
using ::std::lock_guard; // NOLINT
using ::std::unique_lock; // NOLINT
}发布于 2019-05-20 13:02:16
领先的::意味着编译器应该开始从全局范围寻找实例化对象的定义。
因此using ::std::mutex意味着从全局作用域开始,转到std命名空间,并在当前命名空间stdx中使用mutex类。
https://stackoverflow.com/questions/56214522
复制相似问题