summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/NeKit/Ref.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/NeKit/Ref.h')
-rw-r--r--src/kernel/NeKit/Ref.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kernel/NeKit/Ref.h b/src/kernel/NeKit/Ref.h
index b4d6cb5e..2010f3e9 100644
--- a/src/kernel/NeKit/Ref.h
+++ b/src/kernel/NeKit/Ref.h
@@ -26,7 +26,9 @@ class Ref final {
~Ref() = default;
public:
- using Type = T;
+ using Type = T;
+ using ConstType = const T&;
+ using RefType = T&;
Ref(Type* cls) : fClass(*cls) {}
Ref(Type cls) : fClass(cls) {}
@@ -50,7 +52,10 @@ class Ref final {
Type& Leak() { return fClass; }
- Type& TryLeak() { return fClass; }
+ Type& TryLeak() {
+ MUST_PASS(fClass);
+ return fClass;
+ }
Type operator*() { return fClass; }