5#ifndef V8_OBJECTS_UNION_H_
6#define V8_OBJECTS_UNION_H_
21template <
typename... Ts>
25template <
typename... Ts>
27template <
typename... Ts>
29template <
typename... Ts>
34template <
typename Accumulator,
typename TWithout,
typename... InputTypes>
38template <
typename... OutputTs,
typename TWithout>
45template <
typename... OutputTs,
typename TWithout,
typename... Ts>
51template <
typename... OutputTs,
typename TWithout,
typename Head,
61template <
typename... Ts>
65 "Cannot have a union of unions -- use the UnionOf<T...> helper "
66 "to flatten nested unions");
69 "Unions should have each type only once -- use the UnionOf<T...> "
70 "helper to deduplicate unions");
78template <
typename Accumulator,
typename... InputTypes>
82template <
typename... OutputTs>
88template <
typename... OutputTs,
typename Head,
typename... Ts>
91 using type = std::conditional_t<
102template <
typename... OutputTs,
typename... Ts>
105 using type = std::conditional_t<
112template <
typename... OutputTs,
typename... HeadTs,
typename... Ts>
122template <
typename... Ts>
126static_assert(std::is_same_v<Union<Smi, HeapObject>,
129static_assert(std::is_same_v<Union<Smi, HeapObject>,
137static_assert(std::is_same_v<JSAny::Without<Smi>,
JSAnyNotSmi>);
142static_assert(std::is_same_v<Union<Smi, HeapObject>::Without<
HeapNumber>,
typename detail::UnionWithoutHelper< Union<>, U, Ts... >::type Without
constexpr bool has_type_v
V8_EXPORT_PRIVATE TypeInModule Union(ValueType type1, ValueType type2, const WasmModule *module1, const WasmModule *module2)
static constexpr bool is_union_v
typename detail::FlattenUnionHelper< Union<>, Ts... >::type UnionOf
std::conditional_t< base::has_type_v< Head, OutputTs... >, typename FlattenUnionHelper< Union< OutputTs... >, Ts... >::type, typename FlattenUnionHelper< Union< OutputTs..., Head >, Ts... >::type > type
std::conditional_t< base::has_type_v< Smi, OutputTs... >, typename FlattenUnionHelper< Union< OutputTs... >, Ts... >::type, typename FlattenUnionHelper< Union< Smi, OutputTs... >, Ts... >::type > type
typename FlattenUnionHelper< Union< OutputTs... >, HeadTs..., Ts... >::type type
typename UnionWithoutHelper< Union< OutputTs..., Head >, TWithout, Ts... >::type type