Another template/static member question

Harvey Chapman hchapman-gcc-help@3gfp.com
Wed Feb 13 06:25:00 GMT 2008


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 -a
Darwin 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20080213/bc77a8b9/attachment-0001.sig>


More information about the Gcc-help mailing list