Add const operator* to optional.

This commit is contained in:
levlam 2024-06-05 14:02:51 +03:00
parent b102c3adef
commit 9f138ba596

View File

@ -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());