From e01497632b78697165623a67b16c95b8d0f6c8a7 Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 20 Mar 2003 03:03:11 +0000 Subject: fix inlining problem --- factory.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'factory.h') diff --git a/factory.h b/factory.h index 42670b7d..893a731f 100644 --- a/factory.h +++ b/factory.h @@ -54,17 +54,21 @@ public: return factory ? factory->CreateObject() : NULL; } - static ObjectFactoryRegistry & Registry() - { - static ObjectFactoryRegistry s_registry; - return s_registry; - } + // VC60 workaround: use "..." to prevent this function from being inlined + static ObjectFactoryRegistry & Registry(...); private: typedef std::map *> Map; Map m_map; }; +template +ObjectFactoryRegistry & ObjectFactoryRegistry::Registry(...) +{ + static ObjectFactoryRegistry s_registry; + return s_registry; +} + template void RegisterDefaultFactoryFor(const char *name, AbstractClass *Dummy1=NULL, ConcreteClass *Dummy2=NULL) { -- cgit v1.2.1