feat as const function for promise
Some checks failed
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 1m14s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 1m53s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 1m57s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 1m55s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 2m10s
linux-arm-gcc / linux-gcc-armhf (push) Failing after 2m15s

This commit is contained in:
tqcq 2024-04-19 11:09:56 +08:00
parent 5f44cdb835
commit 2268a7e4aa

View File

@ -29,14 +29,14 @@ public:
bool IsFilled() const noexcept { return future_.IsCompleted(); } bool IsFilled() const noexcept { return future_.IsCompleted(); }
void Failure(const FailureT &reason) { return future_.FillFailure(reason); } void Failure(const FailureT &reason) const noexcept { return future_.FillFailure(reason); }
void Success(const T &value) { return future_.FillSuccess(value); } void Success(const T &value) const noexcept { return future_.FillSuccess(value); }
void Success(T &&value) { return future_.FillSuccess(std::move(value)); } void Success(T &&value) const noexcept { return future_.FillSuccess(std::move(value)); }
private: private:
Future<T, FailureT> future_ = Future<T, FailureT>::Create(); mutable Future<T, FailureT> future_ = Future<T, FailureT>::Create();
}; };
}// namespace sled }// namespace sled