mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Expose memory offset of Optional's internal fields
This commit is contained in:
parent
af5fd99ff4
commit
bdce36dddb
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/bdce36dddb Pull-request: https://github.com/SerenityOS/serenity/pull/21822 Reviewed-by: https://github.com/DanShaders Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 3 additions and 0 deletions
|
@ -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 };
|
||||
|
|
Loading…
Reference in a new issue