Variable template in template class - unexpected error (possible bug?)

后端 未结 2 1891
眼角桃花
眼角桃花 2021-01-01 16:37

Having:

struct Value
{
    template
    static constexpr T value{0};
};

(0) ideone

te         


        
2条回答
  •  -上瘾入骨i
    2021-01-01 17:01

    I've had some headaches before when creating template class header files in c++.

    Make sure you implementation of static constexpr T value{0}; is in the same header file as the declaration.

提交回复
热议问题