fix: downcasting_2.0 workaround for MSVC

This commit is contained in:
Mateusz Pusz
2020-09-12 21:19:40 +02:00
parent caae7675d6
commit be46ac77d6

View File

@ -77,10 +77,15 @@ enum class downcast_mode {
automatic = 2 // downcasting automatically enabled if no collisions are present
};
template<typename Target, Downcastable T, downcast_mode mode = static_cast<downcast_mode>(DOWNCAST_MODE)>
struct downcast_dispatch : std::conditional_t<mode == downcast_mode::off, T,
#ifdef COMP_MSVC
downcast_child<Target, T>> {};
#else
std::conditional_t<mode == downcast_mode::automatic && has_downcast_guide<T>,
downcast_poison<T>, downcast_child<Target, T>>> {};
#endif
namespace detail {