utils: add noexcept qualifier to ImmediateFuture

Summary: This should help the compiler generate even better code.

Reviewed By: chadaustin

Differential Revision: D28153979

fbshipit-source-id: b1d84c92af4fa760c92624c53d7f57330d7706fa
This commit is contained in:
Xavier Deguillard 2021-05-11 08:04:06 -07:00 committed by Facebook GitHub Bot
parent 3575f87d39
commit f331a0c3f9

View File

@ -32,21 +32,24 @@ class ImmediateFuture {
* Construct an ImmediateFuture with an already constructed value. No
* folly::SemiFuture will be allocated.
*/
/* implicit */ ImmediateFuture(folly::Try<T>&& value) noexcept
: inner_(std::move(value)) {}
/* implicit */ ImmediateFuture(folly::Try<T>&& value) noexcept(
std::is_nothrow_move_constructible_v<folly::Try<T>>)
: inner_{std::move(value)} {}
/**
* Construct an ImmediateFuture with an already constructed value. No
* folly::SemiFuture will be allocated.
*/
/* implicit */ ImmediateFuture(T value) noexcept
: ImmediateFuture(folly::Try<T>(std::move(value))) {}
/* implicit */ ImmediateFuture(T value) noexcept(
std::is_nothrow_move_constructible_v<folly::Try<T>>)
: ImmediateFuture{folly::Try<T>{std::move(value)}} {}
/**
* Construct an ImmediateFuture with a SemiFuture.
*/
/* implicit */ ImmediateFuture(folly::SemiFuture<T>&& fut) noexcept
: inner_(std::move(fut)) {}
/* implicit */ ImmediateFuture(folly::SemiFuture<T>&& fut) noexcept(
std::is_nothrow_move_constructible_v<folly::SemiFuture<T>>)
: inner_{std::move(fut)} {}
~ImmediateFuture() = default;