From bfa136e8d03598ce35e0c301371850e0990e1c55 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Fri, 19 Apr 2024 03:38:57 +0000 Subject: [PATCH] feat set default value --- src/sled/futures/future.h | 3 ++- src/sled/futures/internal/promise.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sled/futures/future.h b/src/sled/futures/future.h index d16181e..701dbc1 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..2265a56 100644 --- a/src/sled/futures/internal/promise.h +++ b/src/sled/futures/internal/promise.h @@ -10,8 +10,8 @@ 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");