Skip to content

Commit

Permalink
[Util] Add dereference operator and member access through pointer for…
Browse files Browse the repository at this point in the history
… OptField class
  • Loading branch information
Nora Buschauer committed May 15, 2024
1 parent 96ce63a commit 2f1f061
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/mutable/util/OptField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
};

Expand Down

0 comments on commit 2f1f061

Please sign in to comment.