mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 22:07:44 +03:00
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:
parent
3575f87d39
commit
f331a0c3f9
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user