diff --git a/include/boost/variant2/variant.hpp b/include/boost/variant2/variant.hpp index e296d54..ad92069 100644 --- a/include/boost/variant2/variant.hpp +++ b/include/boost/variant2/variant.hpp @@ -1171,16 +1171,20 @@ public: // modifiers - template, U>, class E = typename std::enable_if::value>::type> + template, U>::value == 1 && std::is_constructible::value >::type> BOOST_CXX14_CONSTEXPR U& emplace( A&&... a ) { + using I = mp_find, U>; variant_base::template emplace( std::forward(a)... ); return _get_impl( I() ); } - template, U>, class E = typename std::enable_if&, A...>::value>::type> + template, U>::value == 1 && std::is_constructible&, A...>::value >::type> BOOST_CXX14_CONSTEXPR U& emplace( std::initializer_list il, A&&... a ) { + using I = mp_find, U>; variant_base::template emplace( il, std::forward(a)... ); return _get_impl( I() ); }