diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 15:00:21 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 15:00:21 +0100 |
commit | e980f88c08e05d3c3d0ae7ff7422ec9e686ecfa4 (patch) | |
tree | dbf603db33c75e13cfeb255d8fcf789f4b2b82bc /src/crepe/util/OptionalRef.h | |
parent | a597b0059f30e9d56331c6ece34fdcabb4028616 (diff) | |
parent | 78c4a8772526f40c531b5402b56932b0a41e22e8 (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/util/OptionalRef.h')
-rw-r--r-- | src/crepe/util/OptionalRef.h | 10 |
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 |