From df7248039553b3ebd338380c3ef0428b0e046e79 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 14 Aug 2020 09:38:45 -0400 Subject: common: Make use of [[nodiscard]] where applicable Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions. --- src/common/spin_lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/spin_lock.h') diff --git a/src/common/spin_lock.h b/src/common/spin_lock.h index 1df5528c4..4f946a258 100644 --- a/src/common/spin_lock.h +++ b/src/common/spin_lock.h @@ -17,7 +17,7 @@ class SpinLock { public: void lock(); void unlock(); - bool try_lock(); + [[nodiscard]] bool try_lock(); private: std::atomic_flag lck = ATOMIC_FLAG_INIT; -- cgit v1.2.3