模板类中的变量模板-意外错误(可能的错误?) [英] Variable template in template class - unexpected error (possible bug?)

查看:156
本文介绍了模板类中的变量模板-意外错误(可能的错误?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有:

struct Value
{
    template<class T>
    static constexpr T value{0};
};


(0) ideone

template<typename TValue>
struct Something
{
    void x()
    {
        static_assert(TValue::template value<int> == 0, "");
    }
};

int main() { Something<Value>{}.x(); return 0; } 

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆