2023-11-03 19:46:27 -07:00
|
|
|
#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_; }
|
2023-11-19 18:45:13 -08:00
|
|
|
T& get() const { return ref_; }
|
2023-11-03 19:46:27 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
T& ref_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace glcr
|