diff --git a/src/sled/futures/future.h b/src/sled/futures/future.h index 593e423..61b10d7 100644 --- a/src/sled/futures/future.h +++ b/src/sled/futures/future.h @@ -1,6 +1,7 @@ #ifndef SLED_FUTURES_FUTURE_H #define SLED_FUTURES_FUTURE_H +#include #pragma once #include "sled/exec/detail/invoke_result.h" #include "sled/futures/internal/failure_handling.h" @@ -59,7 +60,7 @@ struct FutureData { // -template +template class Future { static_assert(!std::is_same::value, "Future is not allowed. Use Future instead"); static_assert(!std::is_same::value, "Future<_, void> is not allowed. Use Future<_, bool> instead"); diff --git a/src/sled/futures/internal/promise.h b/src/sled/futures/internal/promise.h index b586569..79201ca 100644 --- a/src/sled/futures/internal/promise.h +++ b/src/sled/futures/internal/promise.h @@ -10,20 +10,20 @@ namespace sled { template class Future; -template -class Promise { +template +class Promise final { static_assert(!std::is_same::value, "Promise is not allowed. Use Promise instead"); static_assert(!std::is_same::value, "Promise<_, void> is not allowed. Use Promise<_, bool> instead"); public: - using Value = T; - Promise() noexcept = default; - Promise(const Promise &) noexcept = default; - Promise(Promise &&) noexcept = default; - Promise &operator=(const Promise &) noexcept = default; - Promise &operator=(Promise &&) noexcept = default; - ~Promise() = default; + using Value = T; + Promise() = default; + Promise(const Promise &) = default; + Promise(Promise &&) noexcept = default; + Promise &operator=(const Promise &) = default; + Promise &operator=(Promise &&) noexcept = default; + ~Promise() = default; Future GetFuture() const { return future_; };