]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/errorator: mark errorator::future 'nodiscard'
authorKefu Chai <kchai@redhat.com>
Wed, 2 Jun 2021 06:15:43 +0000 (14:15 +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/errorator.h

index efe091c8dedd6450cd6f1a93dbcc697f999e93e2..518cd8ad203c419283c649856eae1fc93c9da77c 100644 (file)
@@ -351,9 +351,9 @@ struct errorator {
 private:
   // see the comment for `using future = _future` below.
   template <class>
-  class _future {};
+  class [[nodiscard]] _future {};
   template <class ValueT>
-  class _future<::crimson::errorated_future_marker<ValueT>>
+  class [[nodiscard]] _future<::crimson::errorated_future_marker<ValueT>>
     : private seastar::future<ValueT> {
     using base_t = seastar::future<ValueT>;
     // we need the friendship for the sake of `get_exception() &&` when