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
Loading
Please register or sign in to comment