Skip to content

Commit e28a73c

Browse files
committed
Disabled switch-based visit for MSVC.
1 parent 657110d commit e28a73c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

include/mpark/variant.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,10 @@ namespace mpark {
494494

495495
namespace visitation {
496496

497+
#if defined(MPARK_CPP14_CONSTEXPR) && !defined(_MSC_VER)
498+
#define MPARK_VARIANT_SWITCH_VISIT
499+
#endif
500+
497501
struct base {
498502
template <typename Visitor, typename... Vs>
499503
using dispatch_result_t = decltype(
@@ -521,7 +525,7 @@ namespace mpark {
521525
lib::forward<Alts>(alts)...))
522526
};
523527

524-
#ifdef MPARK_CPP14_CONSTEXPR
528+
#ifdef MPARK_VARIANT_SWITCH_VISIT
525529
template <bool B, typename R, typename... ITs>
526530
struct dispatcher;
527531

@@ -802,7 +806,7 @@ namespace mpark {
802806
#endif
803807
};
804808

805-
#ifndef MPARK_CPP14_CONSTEXPR
809+
#ifndef MPARK_VARIANT_SWITCH_VISIT
806810
template <typename F, typename... Vs>
807811
using fmatrix_t = decltype(base::make_fmatrix<F, Vs...>());
808812

@@ -846,7 +850,7 @@ namespace mpark {
846850
template <typename Visitor, typename... Vs>
847851
inline static constexpr DECLTYPE_AUTO visit_alt(Visitor &&visitor,
848852
Vs &&... vs)
849-
#ifdef MPARK_CPP14_CONSTEXPR
853+
#ifdef MPARK_VARIANT_SWITCH_VISIT
850854
DECLTYPE_AUTO_RETURN(
851855
base::dispatcher<
852856
true,
@@ -867,7 +871,7 @@ namespace mpark {
867871
inline static constexpr DECLTYPE_AUTO visit_alt_at(std::size_t index,
868872
Visitor &&visitor,
869873
Vs &&... vs)
870-
#ifdef MPARK_CPP14_CONSTEXPR
874+
#ifdef MPARK_VARIANT_SWITCH_VISIT
871875
DECLTYPE_AUTO_RETURN(
872876
base::dispatcher<
873877
true,

0 commit comments

Comments
 (0)