mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
We specialize `Optional<T>` for value types that inherently support some kind of "empty" value or whose value range allow for a unlikely to be useful sentinel value that can mean "empty", instead of the boolean flag a regular Optional<T> needs to store. Because of padding, this often means saving 4 to 8 bytes per instance. By extending the new `SentinelOptional<T, Traits>`, these specializations are significantly simplified to just having to define what the sentinel value is, and how to identify a sentinel value.
1.5 KiB
1.5 KiB