From 2f1f06133f1f4f586b217c3d6dc2e8635774b9a4 Mon Sep 17 00:00:00 2001 From: Nora Buschauer Date: Tue, 14 May 2024 22:54:34 +0200 Subject: [PATCH] [Util] Add dereference operator and member access through pointer for OptField class --- include/mutable/util/OptField.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mutable/util/OptField.hpp b/include/mutable/util/OptField.hpp index 085061c8..a46cb939 100644 --- a/include/mutable/util/OptField.hpp +++ b/include/mutable/util/OptField.hpp @@ -30,6 +30,12 @@ struct OptField return *this; } + T & operator*() { return value_; } + const T & operator*() const { return value_; } + + T * operator->() { return &value_; } + const T * operator->() const { return &value_; } + friend std::ostream & operator<<(std::ostream &out, const OptField &F) { return out << F.value_; } };