diff --git a/include/mapnik/util/variant.hpp b/include/mapnik/util/variant.hpp index d6f800251..88a81f5b5 100644 --- a/include/mapnik/util/variant.hpp +++ b/include/mapnik/util/variant.hpp @@ -541,21 +541,11 @@ public: : type_index(detail::invalid_value) {} template ::value>::type> - VARIANT_INLINE explicit variant(T const& val) noexcept - : type_index(detail::value_traits::index) - { - constexpr std::size_t index = sizeof...(Types) - detail::value_traits::index - 1; - using target_type = typename detail::select_type::type; - new (&data) target_type(val); - } - - template ::value>::type> + detail::is_valid_type::type, Types...>::value>::type> VARIANT_INLINE variant(T && val) noexcept - : type_index(detail::value_traits::index) + : type_index(detail::value_traits::type, Types...>::index) { - constexpr std::size_t index = sizeof...(Types) - detail::value_traits::index - 1; + constexpr std::size_t index = sizeof...(Types) - detail::value_traits::type, Types...>::index - 1; using target_type = typename detail::select_type::type; new (&data) target_type(std::forward(val)); // nothrow }