I implement an template which have static member variable, after read the standard, seams it is correct to define the variable in the .h file, but the .h file is included in multiple .cpp, so why the static variable is not multiple definition?
Any reference in standard for that?
14.5.1.3 in N3376
A definition for a static data member may be provided in a namespace scope enclosing the definition of the static member’s class template. [Example:
template<class T> class X { static T s; };
template<class T> T X<T>::s = 0;
<-------------Question here.—end example ]