修复问题

This commit is contained in:
2026-08-09 15:30:12 +08:00
parent bc70f8c34c
commit a058242536
2 changed files with 10 additions and 2 deletions
+3 -2
View File
@@ -297,11 +297,12 @@ public:
std::invoke(std::forward<Function>(function), value_);
});
} else {
std::optional<std::remove_cvref_t<Result>> result;
using Value_Result = std::remove_cvref_t<Result>;
std::optional<Value_Result> result;
this->with_all_writable_locked([&](auto&) {
result.emplace(std::invoke(std::forward<Function>(function), value_));
});
return std::move(*result);
return Value_Result(std::move(*result));
}
}
T snapshot() const requires std::copy_constructible<T> {