]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/interruptible_future: mark future 'nodiscard' 41637/head
authorKefu Chai <kchai@redhat.com>
Wed, 2 Jun 2021 06:16:25 +0000 (14:16 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 2 Jun 2021 06:17:24 +0000 (14:17 +0800)
so compiler is able to error out if we discard a future.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/interruptible_future.h

index 5c64a514bcb13209dce975ff99f274283eeb59e5..69ecbe11054d706c9df112808a06fb321520c409 100644 (file)
@@ -64,7 +64,7 @@ template <typename InterruptCond>
 thread_local InterruptCondRef<InterruptCond> interrupt_cond;
 
 template <typename InterruptCond, typename FutureType>
-class interruptible_future_detail {};
+class [[nodiscard]] interruptible_future_detail {};
 
 template <typename FutureType>
 struct is_interruptible_future : public std::false_type {};
@@ -233,7 +233,7 @@ Result non_futurized_call_with_interruption(
 }
 
 template <typename InterruptCond, typename T>
-class interruptible_future_detail<InterruptCond, seastar::future<T>>
+class [[nodiscard]] interruptible_future_detail<InterruptCond, seastar::future<T>>
   : private seastar::future<T> {
 public:
   using core_type = seastar::future<T>;
@@ -518,7 +518,7 @@ struct interruptible_errorator {
 template <typename InterruptCond,
          template <typename...> typename ErroratedFuture,
          typename T>
-class interruptible_future_detail<
+class [[nodiscard]] interruptible_future_detail<
   InterruptCond,
   ErroratedFuture<::crimson::errorated_future_marker<T>>>
   : private ErroratedFuture<::crimson::errorated_future_marker<T>>