From a98326eb2954ac1e79f5eac28dbeab3ec15e047f Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Sat, 30 Jun 2018 12:43:08 +0200 Subject: 10.1 --- zen/globals.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'zen/globals.h') diff --git a/zen/globals.h b/zen/globals.h index 2066c380..10975414 100755 --- a/zen/globals.h +++ b/zen/globals.h @@ -21,10 +21,12 @@ class Global public: Global() { - static_assert(std::is_trivially_destructible::value, "this memory needs to live forever"); + static_assert(std::is_trivially_destructible_v, "this memory needs to live forever"); assert(!pod_.inst && !pod_.spinLock); //we depend on static zero-initialization! } + explicit Global(std::unique_ptr&& newInst) { set(std::move(newInst)); } + ~Global() { set(nullptr); } std::shared_ptr get() //=> return std::shared_ptr to let instance life time be handled by caller (MT usage!) @@ -60,7 +62,6 @@ private: //serialize access; can't use std::mutex: has non-trival destructor } pod_; }; - } #endif //GLOBALS_H_8013740213748021573485 -- cgit