AK: Make Variant's index type public

This will allow the IPC system to use the exact required index type,
saving transmission space, once it can send variants.
This commit is contained in:
kleines Filmröllchen 2022-11-09 16:57:26 +01:00 committed by Tim Flynn
parent 232b40fefc
commit 5b4818df22

View file

@ -225,8 +225,9 @@ IsLvalueReference<T>;
template<NotLvalueReference... Ts>
struct Variant
: public Detail::MergeAndDeduplicatePacks<Detail::VariantConstructors<Ts, Variant<Ts...>>...> {
private:
public:
using IndexType = Conditional<sizeof...(Ts) < 255, u8, size_t>; // Note: size+1 reserved for internal value checks
private:
static constexpr IndexType invalid_index = sizeof...(Ts);
template<typename T>