|
|
|
@ -498,8 +498,8 @@ struct VisitIndicesVariadicImpl<absl::index_sequence<N...>, EndIndices...> { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template <class Op, class... SizeType> |
|
|
|
|
static VisitIndicesResultT<Op, decltype(EndIndices)...> Run( |
|
|
|
|
Op&& op, SizeType... i) { |
|
|
|
|
static VisitIndicesResultT<Op, decltype(EndIndices)...> Run(Op&& op, |
|
|
|
|
SizeType... i) { |
|
|
|
|
return VisitIndicesSwitch<NumCasesOfSwitch<EndIndices...>::value>::Run( |
|
|
|
|
FlattenedOp<Op>{absl::forward<Op>(op)}, |
|
|
|
|
FlattenIndices<(EndIndices + std::size_t{1})...>::Run( |
|
|
|
@ -868,18 +868,6 @@ struct IsNeitherSelfNorInPlace<Self, in_place_type_t<T>> : std::false_type {}; |
|
|
|
|
template <class Self, std::size_t I> |
|
|
|
|
struct IsNeitherSelfNorInPlace<Self, in_place_index_t<I>> : std::false_type {}; |
|
|
|
|
|
|
|
|
|
template <class Variant, class T, class = void> |
|
|
|
|
struct ConversionIsPossibleImpl : std::false_type {}; |
|
|
|
|
|
|
|
|
|
template <class Variant, class T> |
|
|
|
|
struct ConversionIsPossibleImpl< |
|
|
|
|
Variant, T, |
|
|
|
|
void_t<decltype(ImaginaryFun<Variant>::Run(std::declval<T>(), {}))>> |
|
|
|
|
: std::true_type {}; |
|
|
|
|
|
|
|
|
|
template <class Variant, class T> |
|
|
|
|
struct ConversionIsPossible : ConversionIsPossibleImpl<Variant, T>::type {}; |
|
|
|
|
|
|
|
|
|
template <class Variant, class T> |
|
|
|
|
struct IndexOfConstructedType< |
|
|
|
|
Variant, T, |
|
|
|
@ -1151,16 +1139,16 @@ struct VariantHelper<variant<Ts...>> { |
|
|
|
|
// Type metafunction which returns the element type selected if
|
|
|
|
|
// OverloadSet::Overload() is well-formed when called with argument type U.
|
|
|
|
|
template <typename U> |
|
|
|
|
using BestMatch = decltype( |
|
|
|
|
variant_internal::OverloadSet<Ts...>::Overload(std::declval<U>())); |
|
|
|
|
using BestMatch = decltype(variant_internal::OverloadSet<Ts...>::Overload( |
|
|
|
|
std::declval<U>())); |
|
|
|
|
|
|
|
|
|
// Type metafunction which returns true if OverloadSet::Overload() is
|
|
|
|
|
// well-formed when called with argument type U.
|
|
|
|
|
// CanAccept can't be just an alias because there is a MSVC bug on parameter
|
|
|
|
|
// pack expansion involving decltype.
|
|
|
|
|
template <typename U> |
|
|
|
|
struct CanAccept : |
|
|
|
|
std::integral_constant<bool, !std::is_void<BestMatch<U>>::value> {}; |
|
|
|
|
struct CanAccept |
|
|
|
|
: std::integral_constant<bool, !std::is_void<BestMatch<U>>::value> {}; |
|
|
|
|
|
|
|
|
|
// Type metafunction which returns true if Other is an instantiation of
|
|
|
|
|
// variant, and variants's converting constructor from Other will be
|
|
|
|
@ -1183,8 +1171,8 @@ struct TrivialMoveOnly { |
|
|
|
|
// A union's defaulted copy/move constructor is deleted if any variant member's
|
|
|
|
|
// copy/move constructor is nontrivial.
|
|
|
|
|
template <typename T> |
|
|
|
|
struct IsTriviallyMoveConstructible: |
|
|
|
|
std::is_move_constructible<Union<T, TrivialMoveOnly>> {}; |
|
|
|
|
struct IsTriviallyMoveConstructible |
|
|
|
|
: std::is_move_constructible<Union<T, TrivialMoveOnly>> {}; |
|
|
|
|
|
|
|
|
|
// To guarantee triviality of all special-member functions that can be trivial,
|
|
|
|
|
// we use a chain of conditional bases for each one.
|
|
|
|
|