[libcxx-commits] [libcxx] [libc++] Applied `[[nodiscard]]` to concurrency (partially) (PR #169463)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 25 03:47:37 PST 2025


================
@@ -133,7 +133,7 @@ class counting_semaphore {
 public:
   static_assert(__least_max_value >= 0, "The least maximum value must be a positive number");
 
-  static constexpr ptrdiff_t max() noexcept { return __least_max_value; }
+  [[nodiscard]] static constexpr ptrdiff_t max() noexcept { return __least_max_value; }
----------------
philnik777 wrote:

Again, the `try_*` functions below.

https://github.com/llvm/llvm-project/pull/169463


More information about the libcxx-commits mailing list