From f355d27aea3a1cd7c4e34a14e0e60835bb757653 Mon Sep 17 00:00:00 2001 From: Glen Fraser Date: Fri, 4 Sep 2020 13:52:25 +0200 Subject: [PATCH] Fix GCC build error "explicit specialization in non-namespace scope" - other compilers don't complain, but for GCC needed to move the template constructor specialization (array of size 0) outside the class declaration. --- include/chaiscript/dispatchkit/function_params.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/chaiscript/dispatchkit/function_params.hpp b/include/chaiscript/dispatchkit/function_params.hpp index 249c41a7..70873880 100644 --- a/include/chaiscript/dispatchkit/function_params.hpp +++ b/include/chaiscript/dispatchkit/function_params.hpp @@ -40,12 +40,6 @@ namespace chaiscript { { } - template<> - constexpr explicit Function_Params(const std::array &a) - : m_begin(nullptr), m_end(nullptr) - { - } - [[nodiscard]] constexpr const Boxed_Value &operator[](const std::size_t t_i) const noexcept { return m_begin[t_i]; } @@ -80,6 +74,13 @@ namespace chaiscript { }; + // Constructor specialization for array of size 0 + template<> + constexpr Function_Params::Function_Params(const std::array &a) + : m_begin(nullptr), m_end(nullptr) + { + } + }