Navigation Menu

Skip to content

Commit

Permalink
Disable U&& constructor for derived types
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Mar 12, 2021
1 parent f586dc8 commit 90cda53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/variant2/variant.hpp
Expand Up @@ -1581,7 +1581,7 @@ template<class... T> class variant: private detail::variant_ma_base<T...>

template<class U,
class Ud = typename std::decay<U>::type,
class E1 = typename std::enable_if< !std::is_same<Ud, variant>::value && !detail::is_in_place_index<Ud>::value && !detail::is_in_place_type<Ud>::value >::type,
class E1 = typename std::enable_if< !std::is_same<Ud, variant>::value && !std::is_base_of<variant, Ud>::value && !detail::is_in_place_index<Ud>::value && !detail::is_in_place_type<Ud>::value >::type,
class V = detail::resolve_overload_type<U&&, T...>,
class E2 = typename std::enable_if<std::is_constructible<V, U&&>::value>::type
>
Expand Down

0 comments on commit 90cda53

Please sign in to comment.