From 3ef66b4b0f517a40f12410a224a80c30363ed012 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Fri, 31 Oct 2025 13:13:22 -0400 Subject: [PATCH] work around old compiler constexpr glitch --- include/boost/openmethod/initialize.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/boost/openmethod/initialize.hpp b/include/boost/openmethod/initialize.hpp index 7f829d8..6862cc3 100644 --- a/include/boost/openmethod/initialize.hpp +++ b/include/boost/openmethod/initialize.hpp @@ -476,14 +476,13 @@ void registry::compiler::initialize() { registry::initialized = true; } -#ifdef _MSC_VER namespace detail { template -struct msvc_tuple_get; +struct tuple_get; template -struct msvc_tuple_get { +struct tuple_get { template static decltype(auto) fn(const Tuple& t) { return std::get(t); @@ -491,26 +490,20 @@ struct msvc_tuple_get { }; template -struct msvc_tuple_get { +struct tuple_get { template static decltype(auto) fn(const Tuple&) { return T(); } }; } // namespace detail -#endif template template registry::compiler::compiler(Options... opts) : options(opts...) { if constexpr (has_trace) { -#ifdef _MSC_VER - tr.on = detail::msvc_tuple_get::fn(options).on; -#else - // Even with the constexpr has_trace guard, msvc errors on this. - tr.on = std::get(options).on; -#endif + tr.on = detail::tuple_get::fn(options).on; } }