Add const operator* to optional.
This commit is contained in:
parent
b102c3adef
commit
9f138ba596
@ -60,6 +60,9 @@ class optional {
|
|||||||
T &operator*() {
|
T &operator*() {
|
||||||
return value();
|
return value();
|
||||||
}
|
}
|
||||||
|
const T &operator*() const {
|
||||||
|
return value();
|
||||||
|
}
|
||||||
T unwrap() {
|
T unwrap() {
|
||||||
CHECK(*this);
|
CHECK(*this);
|
||||||
auto res = std::move(value());
|
auto res = std::move(value());
|
||||||
|
Loading…
Reference in New Issue
Block a user