summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2016-11-25 03:02:16 -0800
committerGitHub <noreply@github.com>2016-11-25 03:02:16 -0800
commit3a68fbe656c1984b6cf1b921d29225807d4d4ca0 (patch)
tree3ffd25a72f89b320fff78412876e93f234df1832 /include
parentc4b5018ca57213601d0b31139be8c4268a308910 (diff)
parent40dd0067af0dcf12c8723220bed29b0bea177dc8 (diff)
downloadastra-3a68fbe656c1984b6cf1b921d29225807d4d4ca0.tar.gz
astra-3a68fbe656c1984b6cf1b921d29225807d4d4ca0.tar.bz2
astra-3a68fbe656c1984b6cf1b921d29225807d4d4ca0.tar.xz
astra-3a68fbe656c1984b6cf1b921d29225807d4d4ca0.zip
Merge pull request #77 from wjp/singleton
Change order of template instantiations
Diffstat (limited to 'include')
-rw-r--r--include/astra/Singleton.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/astra/Singleton.h b/include/astra/Singleton.h
index 9d3c088..7271691 100644
--- a/include/astra/Singleton.h
+++ b/include/astra/Singleton.h
@@ -82,15 +82,15 @@ class Singleton {
// libastra. This situation would cause issues when .mex files are unloaded.
#define DEFINE_SINGLETON(T) \
-template<> void Singleton<T >::construct() { assert(!m_singleton); m_singleton = new T(); } \
-template<> T* Singleton<T >::m_singleton = 0
+template<> T* Singleton<T >::m_singleton = 0; \
+template<> void Singleton<T >::construct() { assert(!m_singleton); m_singleton = new T(); }
// This is a hack to support statements like
// DEFINE_SINGLETON2(CTemplatedClass<C1, C2>);
#define DEFINE_SINGLETON2(A,B) \
-template<> void Singleton<A,B >::construct() { assert(!m_singleton); m_singleton = new A,B(); } \
-template<> A,B* Singleton<A,B >::m_singleton = 0
+template<> A,B* Singleton<A,B >::m_singleton = 0; \
+template<> void Singleton<A,B >::construct() { assert(!m_singleton); m_singleton = new A,B(); }
} // end namespace