AK: Expose memory offset of Optional's internal fields

This commit is contained in:
Andreas Kling 2023-11-06 15:18:38 +01:00
parent af5fd99ff4
commit bdce36dddb
Notes: sideshowbarker 2024-07-17 20:19:08 +09:00

View file

@ -318,6 +318,9 @@ public:
}
}
static FlatPtr value_offset() { return OFFSET_OF(Optional, m_storage); }
static FlatPtr has_value_offset() { return OFFSET_OF(Optional, m_has_value); }
private:
alignas(T) u8 m_storage[sizeof(T)];
bool m_has_value { false };