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:
parent
68a09a05be
commit
f628dc7165
5 changed files with 28 additions and 18 deletions
|
@ -19,24 +19,22 @@
|
|||
class Foo;
|
||||
|
||||
// Use the predefined Loki::Singleton
|
||||
// and export Loki::Singleton<Foo>
|
||||
// of loki/Singleton.h and use the export
|
||||
// specifier of the current library
|
||||
#define LOKI_SINGLETON_EXPORT SINGLETONDLL_EXPORT
|
||||
#include <loki/Singleton.h>
|
||||
|
||||
template class SINGLETONDLL_EXPORT Loki::Singleton<Foo>;
|
||||
|
||||
|
||||
// declare the Singleton template by yourself
|
||||
// and export Singleton<Foo>
|
||||
// so the singleton is not in the Loki namespace
|
||||
// and export Singleton<Foo>, so the singleton
|
||||
// is not in the Loki namespace
|
||||
template<class T>
|
||||
class Singleton
|
||||
class SINGLETONDLL_EXPORT Singleton
|
||||
{
|
||||
public:
|
||||
static T& Instance();
|
||||
};
|
||||
|
||||
template class SINGLETONDLL_EXPORT Singleton<Foo>;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue