-8

クラスの定義でこれ (static_assert) が機能しないのはなぜですか?

template<class IntT, IntT low = IntT(), IntT high = IntT()>
struct X 
{
    static_assert(std::is_same<decltype(low),decltype(high)>::value,"Different types not allowed");
};



int _tmain(int argc, _TCHAR* argv[])
{
    int low, high;

    X<char,1,'a'> x;//HERE I SHOULD GET ERROR
    cout << sizeof(x);

    return 0;
}
4

1 に答える 1