File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -476,34 +476,41 @@ void registry<Policies...>::compiler<Options...>::initialize() {
476476 registry<Policies...>::initialized = true ;
477477}
478478
479+ #ifdef _MSC_VER
479480namespace detail {
480481
481482template <bool HasTrace, typename T>
482- struct tuple_get ;
483+ struct msvc_tuple_get ;
483484
484485template <typename T>
485- struct tuple_get <true , T> {
486+ struct msvc_tuple_get <true , T> {
486487 template <class Tuple >
487488 static decltype (auto ) fn(const Tuple& t) {
488489 return std::get<T>(t);
489490 }
490491};
491492
492493template <typename T>
493- struct tuple_get <false , T> {
494+ struct msvc_tuple_get <false , T> {
494495 template <class Tuple >
495496 static decltype (auto ) fn(const Tuple&) {
496497 return T ();
497498 }
498499};
499500} // namespace detail
501+ #endif
500502
501503template <class ... Policies>
502504template <class ... Options>
503505registry<Policies...>::compiler<Options...>::compiler(Options... opts)
504506 : options(opts...) {
505507 if constexpr (has_trace) {
506- tr.on = detail::tuple_get<has_trace, trace>::fn (options).on ;
508+ #ifdef _MSC_VER
509+ tr.on = detail::msvc_tuple_get<has_trace, trace>::fn (options).on ;
510+ #else
511+ // Even with the constexpr has_trace guard, msvc errors on this.
512+ tr.on = std::get<trace>(options).on ;
513+ #endif
507514 }
508515}
509516
You can’t perform that action at this time.
0 commit comments