diff --git a/include/boost/openmethod/initialize.hpp b/include/boost/openmethod/initialize.hpp index 6862cc3..7f829d8 100644 --- a/include/boost/openmethod/initialize.hpp +++ b/include/boost/openmethod/initialize.hpp @@ -476,13 +476,14 @@ void registry::compiler::initialize() { registry::initialized = true; } +#ifdef _MSC_VER namespace detail { template -struct tuple_get; +struct msvc_tuple_get; template -struct tuple_get { +struct msvc_tuple_get { template static decltype(auto) fn(const Tuple& t) { return std::get(t); @@ -490,20 +491,26 @@ struct tuple_get { }; template -struct tuple_get { +struct msvc_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) { - tr.on = detail::tuple_get::fn(options).on; +#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 } }