Mark promise helpers as noexcept

This commit is contained in:
Denis Blank 2018-03-06 21:40:37 +01:00
parent 12c23f15f8
commit 73c0b17962

View File

@ -73,31 +73,40 @@ public:
promise_base(OData&& data) : data_(std::forward<OData>(data)) { promise_base(OData&& data) : data_(std::forward<OData>(data)) {
} }
/// Resolves the continuation with the given values /// Resolves the continuation with the given values.
///
/// \throws This method never throws an exception.
/// ///
/// \since 2.0.0 /// \since 2.0.0
void operator()(Args... args) && { void operator()(Args... args) && noexcept {
std::move(data_)(std::move(args)...); std::move(data_)(std::move(args)...);
} }
/// Resolves the continuation with the given exception /// Resolves the continuation with the given exception.
///
/// \throws This method never throws an exception.
/// ///
/// \since 2.0.0 /// \since 2.0.0
void operator()(detail::types::dispatch_error_tag tag, void operator()(detail::types::dispatch_error_tag tag,
detail::types::error_type exception) && { detail::types::error_type exception) &&
noexcept {
std::move(data_)(tag, std::move(exception)); std::move(data_)(tag, std::move(exception));
} }
/// Resolves the continuation with the given values /// Resolves the continuation with the given values.
///
/// \throws This method never throws an exception.
/// ///
/// \since 2.0.0 /// \since 2.0.0
void set_value(Args... args) { void set_value(Args... args) noexcept {
std::move(data_)(std::move(args)...); std::move(data_)(std::move(args)...);
} }
/// Resolves the continuation with the given exception /// Resolves the continuation with the given exception.
///
/// \throws This method never throws an exception.
/// ///
/// \since 2.0.0 /// \since 2.0.0
void set_exception(detail::types::error_type exception) { void set_exception(detail::types::error_type exception) noexcept {
std::move(data_)(detail::types::dispatch_error_tag{}, std::move(exception)); std::move(data_)(detail::types::dispatch_error_tag{}, std::move(exception));
} }
}; };