From 31a6a6dc98147319a0add8a2628434e4e04bd8ce Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 2 Jun 2021 14:16:25 +0800 Subject: [PATCH] crimson/common/interruptible_future: mark future 'nodiscard' so compiler is able to error out if we discard a future. Signed-off-by: Kefu Chai --- src/crimson/common/interruptible_future.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index 5c64a514bcb13..69ecbe11054d7 100644 --- a/src/crimson/common/interruptible_future.h +++ b/src/crimson/common/interruptible_future.h @@ -64,7 +64,7 @@ template thread_local InterruptCondRef interrupt_cond; template -class interruptible_future_detail {}; +class [[nodiscard]] interruptible_future_detail {}; template struct is_interruptible_future : public std::false_type {}; @@ -233,7 +233,7 @@ Result non_futurized_call_with_interruption( } template -class interruptible_future_detail> +class [[nodiscard]] interruptible_future_detail> : private seastar::future { public: using core_type = seastar::future; @@ -518,7 +518,7 @@ struct interruptible_errorator { template typename ErroratedFuture, typename T> -class interruptible_future_detail< +class [[nodiscard]] interruptible_future_detail< InterruptCond, ErroratedFuture<::crimson::errorated_future_marker>> : private ErroratedFuture<::crimson::errorated_future_marker> -- 2.47.3