also compile with gcc
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@583 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
e320b0113d
commit
bc355b1b0a
2 changed files with 7 additions and 5 deletions
|
@ -860,7 +860,7 @@ namespace Loki
|
||||||
/// Put this macro called with a SingletonHolder typedef into your cpp file.
|
/// Put this macro called with a SingletonHolder typedef into your cpp file.
|
||||||
|
|
||||||
#define LOKI_SINGLETON_INSTANCE_DEFINITION(SHOLDER) \
|
#define LOKI_SINGLETON_INSTANCE_DEFINITION(SHOLDER) \
|
||||||
\
|
template<> \
|
||||||
SHOLDER::ObjectType& ::Loki::Singleton<SHOLDER::ObjectType>::Instance() \
|
SHOLDER::ObjectType& ::Loki::Singleton<SHOLDER::ObjectType>::Instance() \
|
||||||
{ \
|
{ \
|
||||||
return SHOLDER::Instance(); \
|
return SHOLDER::Instance(); \
|
||||||
|
@ -883,6 +883,9 @@ namespace Loki
|
||||||
#endif // SINGLETON_INC_
|
#endif // SINGLETON_INC_
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.28 2006/03/03 11:58:24 syntheticpp
|
||||||
|
// also compile with gcc
|
||||||
|
//
|
||||||
// Revision 1.27 2006/02/28 10:31:01 syntheticpp
|
// Revision 1.27 2006/02/28 10:31:01 syntheticpp
|
||||||
// replace tabs
|
// replace tabs
|
||||||
//
|
//
|
||||||
|
|
|
@ -12,14 +12,13 @@
|
||||||
|
|
||||||
// $Header:
|
// $Header:
|
||||||
|
|
||||||
#include <singletondll.h>
|
#include "singletondll.h"
|
||||||
|
|
||||||
#include "foo.h"
|
#include "foo.h"
|
||||||
|
|
||||||
|
|
||||||
typedef Loki::SingletonHolder<Foo> FooSingleton;
|
typedef Loki::SingletonHolder<Foo> FooSingleton;
|
||||||
|
|
||||||
|
|
||||||
LOKI_SINGLETON_INSTANCE_DEFINITION(FooSingleton)
|
LOKI_SINGLETON_INSTANCE_DEFINITION(FooSingleton)
|
||||||
/*
|
/*
|
||||||
// code generated by the macro:
|
// code generated by the macro:
|
||||||
|
@ -29,11 +28,11 @@ Foo& Loki::Singleton<Foo>::Instance()
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template<>
|
||||||
Foo& Singleton<Foo>::Instance()
|
Foo& Singleton<Foo>::Instance()
|
||||||
{
|
{
|
||||||
return FooSingleton::Instance();
|
return FooSingleton::Instance();
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue