[Glacier] Add a binary tree implementation.

Additionally add an optional class to return found values
in the tree. And a reference container (Ref) similar to
std::reference_wrapper to allow storing references in containers.
This commit is contained in:
Drew Galbraith 2023-11-03 19:46:27 -07:00
parent 26b61db021
commit 98f029ae23
4 changed files with 234 additions and 0 deletions

View file

@ -51,6 +51,8 @@ class RefPtr {
T* get() const { return ptr_; };
T& operator*() const { return *ptr_; }
T* operator->() const { return ptr_; }
bool empty() const { return ptr_ == nullptr; }
operator bool() const { return ptr_ != nullptr; }
bool operator==(decltype(nullptr)) const { return (ptr_ == nullptr); }