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:
Andreas Pehrson 2024-03-22 08:17:05 +00:00
Родитель 2fdcd7ef76
Коммит fdd885886a
1 изменённых файлов: 0 добавлений и 17 удалений

Просмотреть файл

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