[libcxx-commits] [libcxx] [libc++][tuple] Applied `[[nodiscard]]` (PR #172008)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 12 07:38:10 PST 2025


================
@@ -491,7 +491,9 @@ public:
     return 0;
   }
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Hp& get() _NOEXCEPT { return static_cast<_Hp&>(*this); }
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Hp& get() _NOEXCEPT {
----------------
frederick-vs-ja wrote:

Why was this function touched?

On the other hand, I think it's worthy marking these `get` functions `[[__nodiscard__]]` despite that they're internal details.

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


More information about the libcxx-commits mailing list