调用时的冗余命名空间限定符

时间:2018-04-11 12:48:27

标签: c++ namespaces argument-dependent-lookup

为什么类别 ::ff(Categories::a)多余?

namespace Outter{
    namespace Categories{
        struct V {};
        V a;
        enum class T { A, B };
        void f(T a);
        void ff(V a);
    }

    void f() {
        auto vec = vector<float>{};
        Categories::f(Categories::T::A); // Nothing redundant.
        Categories::ff(Categories::a);   // Redundant Categories quantifier
                                         // on the call itself.
    }
}

0 个答案:

没有答案