diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-21 09:29:15 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-21 09:29:15 +0100 |
commit | 9d66b6cfccd15a1600c30af5e744e8b0710eeae6 (patch) | |
tree | 16db30a36f8802bc5003f64cacc1e596b6f472a2 /src/crepe/util/OptionalRef.h | |
parent | f7a1ca3b7d934043b48602601e789bad27940405 (diff) |
remove OptionalRef::set and OptionalRef::get
Diffstat (limited to 'src/crepe/util/OptionalRef.h')
-rw-r--r-- | src/crepe/util/OptionalRef.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/crepe/util/OptionalRef.h b/src/crepe/util/OptionalRef.h index 57f9635..253bc07 100644 --- a/src/crepe/util/OptionalRef.h +++ b/src/crepe/util/OptionalRef.h @@ -25,26 +25,20 @@ public: */ OptionalRef<T> & operator=(T & ref); /** - * \brief Check if this reference is not empty - * - * \returns `true` if reference is set, or `false` if it is not - */ - explicit operator bool() const noexcept; - - /** - * \brief Assign new reference - * - * \param ref Reference to assign - */ - void set(T & ref) noexcept; - /** * \brief Retrieve this reference * * \returns Internal reference if it is set * * \throws std::runtime_error if this function is called while the reference it not set */ - T & get() const; + operator T & () const; + /** + * \brief Check if this reference is not empty + * + * \returns `true` if reference is set, or `false` if it is not + */ + explicit operator bool() const noexcept; + /** * \brief Make this reference empty */ |