Skip to content

Commit

Permalink
Add const operator* to optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Jun 5, 2024
1 parent b102c3a commit 9f138ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tdutils/td/utils/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class optional {
T &operator*() {
return value();
}
const T &operator*() const {
return value();
}
T unwrap() {
CHECK(*this);
auto res = std::move(value());
Expand Down

0 comments on commit 9f138ba

Please sign in to comment.