On Tue, Apr 03, 2007 at 07:42:46PM -0400, David Fang wrote:
I may be jumping in a bit late, and without having looked through the source, but are we looking at a violation of the basic one-definition-rule (ODR)?
No. There are no multiple definitions. Only one specialization (which provides best match) is selected by the compiler.
whereby a specialization is providing a definition that is otherwise expected from a primary template?
C++ standard allows this (see e.g. 14.7.3). So, this is OK: template<typename T> class foo { static T data; }; template<typename T> class foo<T*> { static void* data; }; template<typename T> T foo<T>::data = T(1); template<typename T> void* foo<T*>::data = 0;
(For the record, which version are we looking at, so I may check it out?)
CVS HEAD. Best regards, Alexei -- All science is either physics or stamp collecting.