Skip to content

Commit 2f1f061

Browse files
author
Nora Buschauer
committed
[Util] Add dereference operator and member access through pointer for OptField class
1 parent 96ce63a commit 2f1f061

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/mutable/util/OptField.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ struct OptField
3030
return *this;
3131
}
3232

33+
T & operator*() { return value_; }
34+
const T & operator*() const { return value_; }
35+
36+
T * operator->() { return &value_; }
37+
const T * operator->() const { return &value_; }
38+
3339
friend std::ostream & operator<<(std::ostream &out, const OptField &F) { return out << F.value_; }
3440
};
3541

0 commit comments

Comments
 (0)