[libcxx-commits] [libcxx] [libc++][iostream] Applied `[[nodiscard]]` (PR #173754)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 12 00:45:09 PST 2026


================
@@ -298,15 +298,15 @@ public:
   _LIBCPP_HIDE_FROM_ABI basic_istream& ignore(streamsize __n, char_type __delim) {
     return ignore(__n, traits_type::to_int_type(__delim));
   }
-  int_type peek();
+  [[__nodiscard__]] int_type peek();
----------------
philnik777 wrote:

Yeah, I think so - at least for now. This seems like a rather reasonable (if somewhat surprising) usage.

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


More information about the libcxx-commits mailing list