mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
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:
parent
232b40fefc
commit
5b4818df22
Notes:
sideshowbarker
2024-07-17 07:48:42 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: 5b4818df22
Pull-request: https://github.com/SerenityOS/serenity/pull/15991
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 2 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue