------- Comment #3 from redi at gcc dot gnu dot org  2010-06-15 23:18 -------
It's true that your specialization is only a declaration, but this would be a
definition too:

template<>
const int MyTraits<int>::kValue = 1;

It's not true that the declaration has no purpose, it tells the compiler there
is an explicit specialization and the primary template should not be implicitly
instantiated.

That's exactly what's needed if an explicit specialization is defined in
another translation unit, otherwise you get multiple definitions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44552

Reply via email to