acadia/lib/glacier/memory/reference.h
Drew Galbraith 98f029ae23 [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.
2023-11-03 19:46:30 -07:00

18 lines
256 B
C++

#pragma once
namespace glcr {
template <typename T>
class Ref {
public:
Ref(T& ref) : ref_(ref) {}
Ref(const Ref& other) = default;
Ref(Ref&& other) = default;
operator T&() const { return ref_; }
private:
T& ref_;
};
} // namespace glcr