From 8f1243da406aebf5a8cebda65ea84e5dbeeff286 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 29 Sep 2022 17:51:05 -0700 Subject: [PATCH] epicsSingleton: eliminate global ctor with >= c++11 --- modules/libcom/src/cxxTemplates/epicsSingleton.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/libcom/src/cxxTemplates/epicsSingleton.h b/modules/libcom/src/cxxTemplates/epicsSingleton.h index 074ca16fb..21f15c37e 100644 --- a/modules/libcom/src/cxxTemplates/epicsSingleton.h +++ b/modules/libcom/src/cxxTemplates/epicsSingleton.h @@ -23,6 +23,9 @@ class SingletonUntyped { public: +#if __cplusplus>=201103L + constexpr +#endif SingletonUntyped () :_pInstance ( 0 ), _refCount ( 0 ) {} # if 0 ~SingletonUntyped () { @@ -112,6 +115,9 @@ public: epicsSingleton * _pSingleton; }; friend class reference; +#if __cplusplus>=201103L + constexpr +#endif epicsSingleton () {} // mutex lock/unlock pair overhead incurred // when either of these are called