aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util/OptionalRef.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 18:54:56 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-11 18:54:56 +0100
commit904b853a277c3fcd0f84561b6e45bcbd4f0b25c6 (patch)
tree84b8b3d3c29471e4edc2707444b21ac406ee2799 /src/crepe/util/OptionalRef.h
parent876746db205b259430b6b438227c986dbf0cb59d (diff)
parent30c17c98e54c1534664de08ca3838c40c859d166 (diff)
merge master
Diffstat (limited to 'src/crepe/util/OptionalRef.h')
-rw-r--r--src/crepe/util/OptionalRef.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h
index 3201667..1b2cb3f 100644
--- a/src/crepe/util/OptionalRef.h
+++ b/src/crepe/util/OptionalRef.h
@@ -25,7 +25,7 @@ public:
*/
OptionalRef<T> & operator=(T & ref);
/**
- * \brief Retrieve this reference
+ * \brief Retrieve this reference (cast)
*
* \returns Internal reference if it is set
*
@@ -33,6 +33,14 @@ public:
*/
operator T &() const;
/**
+ * \brief Retrieve this reference (member access)
+ *
+ * \returns Internal reference if it is set
+ *
+ * \throws std::runtime_error if this function is called while the reference it not set
+ */
+ T * operator->() const;
+ /**
* \brief Check if this reference is not empty
*
* \returns `true` if reference is set, or `false` if it is not