[libcxx-commits] [libcxx] [libc++] Applied `[[nodiscard]]` to some general utilities (PR #169322)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 24 08:25:15 PST 2025


================
@@ -58,11 +58,11 @@ class reference_wrapper : public __weak_result_type<_Tp> {
 
   // access
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator type&() const _NOEXCEPT { return *__f_; }
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 type& get() const _NOEXCEPT { return *__f_; }
+  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 type& get() const _NOEXCEPT { return *__f_; }
 
   // invoke
   template <class... _ArgTypes>
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<type&, _ArgTypes...>
+  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<type&, _ArgTypes...>
----------------
philnik777 wrote:

Which bullet do you think applies here?

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


More information about the libcxx-commits mailing list