summaryrefslogtreecommitdiffhomepage
path: root/include/CompilerKit/Ref.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 11:05:21 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-11 11:05:21 +0100
commit30a7184205b0cbf2dfc49ed3a52543219008dc32 (patch)
treebd8c80ebf3b9f9025bfe71bef1d1eea0b9b4a075 /include/CompilerKit/Ref.h
parent12107439786af03c0e0580250df4c4ec58d884eb (diff)
chore: Refs container fixes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/CompilerKit/Ref.h')
-rw-r--r--include/CompilerKit/Ref.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/CompilerKit/Ref.h b/include/CompilerKit/Ref.h
index 618a90a..d9b0593 100644
--- a/include/CompilerKit/Ref.h
+++ b/include/CompilerKit/Ref.h
@@ -28,7 +28,8 @@ class StrongRef {
}
}
- NECTI_COPY_DEFAULT(StrongRef)
+ NECTI_COPY_DELETE(StrongRef)
+ NECTI_MOVE_DEFAULT(StrongRef)
using Type = T;
@@ -52,7 +53,7 @@ class StrongRef {
bool IsStrong() const { return m_Strong; }
- explicit operator bool() { return *m_Class; }
+ explicit operator bool() { return m_Class != nullptr; }
private:
Type* m_Class{nullptr};
@@ -67,6 +68,7 @@ class WeakRef final : StrongRef<T> {
~WeakRef() = default;
NECTI_COPY_DELETE(WeakRef)
+ NECTI_MOVE_DEFAULT(WeakRef)
public:
using Type = T;