Commit graph

53 commits

Author SHA1 Message Date
Andreas Kling 1d0b464618 AK: Make HashMap::get(Key) return an Optional<Value>.
This allows HashMap::get() to be used for value types that cannot be default
constructed (e.g NonnullOwnPtr.)
2019-07-24 10:25:43 +02:00
Andreas Kling adb7b1bc4c AK: Add Optional::value_or(T).
This is like value() but with a fallback in case there's no value set.
2019-07-24 07:26:02 +02:00
Andreas Kling 7b2a4c02e7 AK: Add a simple Optional<T> template.
This can be used to store any type, with a flag that says if any value
is present or not.
2019-07-08 11:29:38 +02:00