Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2e85e1b3 authored by Lloyd Pique's avatar Lloyd Pique
Browse files

ftl: non_null improvements

* Disallow NonNull<bool> by checking for nullptr, instead of false.
* Add an "operator bool()" to work like other smart pointers.
* Add [[nodiscard]] where it makes sense.
* Implement the full set of comparison operations, and allow
  comparisons between NonNull<P> and another type Q. This allows the
  use of NonNull<P> in sorted containers like std::set, and allows
  easier lookup via unwrapped pointers.
* Specialize std::hash for NonNull. This allows the use of NonNull<P> in
  hashed containers like std::unordered_set.

Test: atest ftl_test
Bug: 185536303
Change-Id: Ib1090e393ea5f5641be2cd9c61011049039ea615
parent 23550ef3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment