aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/util/OptionalRef.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-12 15:05:33 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-12 15:05:33 +0100
commit641e202607b0f694df6662532f0165022c0f8621 (patch)
tree0701bbfe705a95b670c8dfcb5eaabf6007556831 /src/crepe/util/OptionalRef.h
parentdd7d5cf6b01b8a6a4238b66c27861ee76522067e (diff)
parent05a33d4793520fa84a93bc79882ef29d39cd08e5 (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