Skip to content

Commit 3ef66b4

Browse files
committed
work around old compiler constexpr glitch
1 parent f7d47fb commit 3ef66b4

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

include/boost/openmethod/initialize.hpp

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

479-
#ifdef _MSC_VER
480479
namespace detail {
481480

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

485484
template<typename T>
486-
struct msvc_tuple_get<true, T> {
485+
struct tuple_get<true, T> {
487486
template<class Tuple>
488487
static decltype(auto) fn(const Tuple& t) {
489488
return std::get<T>(t);
490489
}
491490
};
492491

493492
template<typename T>
494-
struct msvc_tuple_get<false, T> {
493+
struct tuple_get<false, T> {
495494
template<class Tuple>
496495
static decltype(auto) fn(const Tuple&) {
497496
return T();
498497
}
499498
};
500499
} // namespace detail
501-
#endif
502500

503501
template<class... Policies>
504502
template<class... Options>
505503
registry<Policies...>::compiler<Options...>::compiler(Options... opts)
506504
: options(opts...) {
507505
if constexpr (has_trace) {
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
506+
tr.on = detail::tuple_get<has_trace, trace>::fn(options).on;
514507
}
515508
}
516509

0 commit comments

Comments
 (0)