From: Kefu Chai Date: Wed, 2 Jun 2021 06:16:25 +0000 (+0800) Subject: crimson/common/interruptible_future: mark future 'nodiscard' X-Git-Tag: v17.1.0~1782^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41637%2Fhead;p=ceph.git crimson/common/interruptible_future: mark future 'nodiscard' so compiler is able to error out if we discard a future. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index 5c64a514bcb..69ecbe11054 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>