summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-07-20 16:19:55 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-10 18:04:14 +0100
commitb512c7e16f2d67ec15989fc7c387157037dd4758 (patch)
tree48846f23966dab5d0dcd954a20c272e578688015 /lib
parentSpecific exception for shader compile error (diff)
downloadilt-b512c7e16f2d67ec15989fc7c387157037dd4758.tar.bz2
ilt-b512c7e16f2d67ec15989fc7c387157037dd4758.tar.xz
ilt-b512c7e16f2d67ec15989fc7c387157037dd4758.zip
Add missing truthy/falsy operators to AnyPtr
Diffstat (limited to 'lib')
-rw-r--r--lib/stdTypeDefs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/stdTypeDefs.h b/lib/stdTypeDefs.h
index beab630..38ebe0b 100644
--- a/lib/stdTypeDefs.h
+++ b/lib/stdTypeDefs.h
@@ -28,6 +28,18 @@ template<typename T> struct AnyPtr {
return *ptr;
}
+ // NOLINTNEXTLINE(hicpp-explicit-conversions)
+ operator bool() const
+ {
+ return ptr != nullptr;
+ }
+
+ bool
+ operator!() const
+ {
+ return ptr == nullptr;
+ }
+
private:
T * ptr;
};