зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1885840 - Remove non-const overloads of apply and map for Maybe<T&>. r=glandium
They don't add any functionality since there is no non-const variant of ref(). Differential Revision: https://phabricator.services.mozilla.com/D204993
This commit is contained in:
Родитель
2fdcd7ef76
Коммит
fdd885886a
17
mfbt/Maybe.h
17
mfbt/Maybe.h
|
@ -736,14 +736,6 @@ class Maybe<T&> {
|
|||
|
||||
void reset() { mValue = nullptr; }
|
||||
|
||||
template <typename Func>
|
||||
Maybe& apply(Func&& aFunc) {
|
||||
if (isSome()) {
|
||||
std::forward<Func>(aFunc)(ref());
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Func>
|
||||
const Maybe& apply(Func&& aFunc) const {
|
||||
if (isSome()) {
|
||||
|
@ -752,15 +744,6 @@ class Maybe<T&> {
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename Func>
|
||||
auto map(Func&& aFunc) {
|
||||
Maybe<decltype(std::forward<Func>(aFunc)(ref()))> val;
|
||||
if (isSome()) {
|
||||
val.emplace(std::forward<Func>(aFunc)(ref()));
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template <typename Func>
|
||||
auto map(Func&& aFunc) const {
|
||||
Maybe<decltype(std::forward<Func>(aFunc)(ref()))> val;
|
||||
|
|
Загрузка…
Ссылка в новой задаче