move instantiation to the source file (fixes linker error with gcc 4.0.1 on the mac), Thanks to Idar Tollefsen and Sam Miller

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@703 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-09-15 06:30:16 +00:00
parent 68a09a05be
commit f628dc7165
5 changed files with 28 additions and 18 deletions

View file

@ -21,6 +21,9 @@ typedef Loki::SingletonHolder<Foo> FooSingleton;
LOKI_SINGLETON_INSTANCE_DEFINITION(FooSingleton)
/*
This code will be generated by the macro,
(ObjectType is a typedef of SingletonHolder):
namespace Loki
{
template<>
@ -35,8 +38,11 @@ namespace Loki
template<>
Foo& Singleton<Foo>::Instance()
{
return FooSingleton::Instance();
return Loki::SingletonHolder<Foo>::Instance();
}
// explicit instantiations
template class Singleton<Foo>;
template class Loki::Singleton<Foo>;