阅读背景:

MSVC错误 - 错误C2373:'description':重新定义;不同的类型修饰符

来源:互联网 
#include <iostream>
#include <type_traits>


namespace MyNS {
    struct Test1 {};
    template <typename > class Test;

    template <> class Test<Test1> {
        public:
            constexpr static char const *description[] = { "X1", "Y1",};
    };
    constexpr char const *Test<Test1>::description[];
    static const char * getDesc(int i) {
        return MyNS::Test<MyNS::Test1>::description[i];
    }
}

int main()
{
    std::cout << MyNS::getDesc(0) << std::endl;
}
#include <iostream>
#include <type_traits>


na



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: