Skip to content

Commit d9edbe9

Browse files
committed
Revert "work around old compiler constexpr glitch"
This reverts commit 3ef66b4.
1 parent 3ef66b4 commit d9edbe9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

include/boost/openmethod/initialize.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,34 +476,41 @@ void registry<Policies...>::compiler<Options...>::initialize() {
476476
registry<Policies...>::initialized = true;
477477
}
478478

479+
#ifdef _MSC_VER
479480
namespace detail {
480481

481482
template<bool HasTrace, typename T>
482-
struct tuple_get;
483+
struct msvc_tuple_get;
483484

484485
template<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

492493
template<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

501503
template<class... Policies>
502504
template<class... Options>
503505
registry<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

0 commit comments

Comments
 (0)