On Feb 13, 2008, at 12:43 AM, Ian Lance Taylor wrote:
Your test case compiled fine when I tried it. You didn't mention what version of gcc you are using, or what system you are running it on. non_lazy_ptr appears to be an Apple thing. I don't know what it is used for.
Mac OS X 10.5.2 $ uname -aDarwin harveybook.local 9.2.0 Darwin Kernel Version 9.2.0: Tue Feb 5 16:15:19 PST 2008; root:xnu-1228.3.13~1/RELEASE_PPC Power Macintosh
$ gcc --version powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
It's just a guess, but I would try interchanging these lines: template class Singleton<SingleClass>; template <class Type> Type * Singleton<Type>::ptr;
That was it! I thought it would be a one-line fix and it turns out to be a no-line fix.
Thanks! This was keeping me from writing a more elegant solution. Harvey
Attachment:
PGP.sig
Description: This is a digitally signed message part