In CMean the array array has no size (which is illegal in standard C++) and therefore has no elements, but you act as if it does.
Since you're using _countof I assume you're using VS. In which case the following warnings should be generated when you compile:
1>c:\...\main.cpp(10): warning C4200: nonstandard extension used: zero-sized array in struct/union
1> note: This member will be ignored by a defaulted constructor or copy/move assignment operator
1> note: see reference to class template instantiation 'CMean<double>' being compiled
1>c:\...\main.cpp(34): warning C4815: 's': zero-sized array in stack object will have no
1> elements (unless the object is an aggregate that has been aggregate initialized)
So it tells you exactly what the problem is. Don't ignore your compiler warnings.