This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: template instantiation and anonymous namespaces
- From: Stefan Lampe <stefanlampe at hotmail dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 15 Jul 2009 01:41:34 +0000
- Subject: RE: template instantiation and anonymous namespaces
- References: <BAY122-W26D1D1A5D34547BCF43783B1200@phx.gbl>
There's still a problem with the template parameters. Let me give the relevant class one last try with escapes:
template<typename ObjectT=Dummy>
class Singleton {
static ObjectT* object;
public:
static ObjectT& Instance() {
if (!object)
object = new ObjectT();
return *object; } };
template<typename ObjectT>
ObjectT* Singleton::object = 0;