I tried to use something like this but the initialization seems not to work. When I remove the type trait, then it works as expected.
template<typename _T, typename = std::enable_if_t<std::is_integral<_T>::value>>
struct Foo
{
static int bar;
};
template<typename _T>
int Foo<_T>::bar = 0;
How to properly initialize such a static variable?