From 7a67963ca77aa2c092348ebf195fadc54c3467dd Mon Sep 17 00:00:00 2001 From: Yuri Yaryshev Date: Thu, 15 Nov 2018 18:59:18 +0300 Subject: [PATCH] Fix: added 'static' to thread_local variable in chaiscript/chaiscript_threading.hpp Because it's a singleton and should be one instance per thread, without it will be singleton per call, also it won't compile on VS2017 15.8.9 The error: chaiscript\include\chaiscript\chaiscript_threading.hpp(107): error C2480: 'my_t': 'thread' is only valid for data items of static extent --- include/chaiscript/chaiscript_threading.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/chaiscript/chaiscript_threading.hpp b/include/chaiscript/chaiscript_threading.hpp index 3875f9cf..9bfa44fc 100644 --- a/include/chaiscript/chaiscript_threading.hpp +++ b/include/chaiscript/chaiscript_threading.hpp @@ -107,7 +107,7 @@ namespace chaiscript /// does there is no possible way to recover static std::unordered_map &t() noexcept { - thread_local std::unordered_map my_t; + static thread_local std::unordered_map my_t; return my_t; } };