llvm-project
e4b8d8a4 - [libc++][istream] Removed `[[nodiscard]]` from `peek()` (#175591)

Commit
15 days ago
[libc++][istream] Removed `[[nodiscard]]` from `peek()` (#175591) Calling `peek()` after constructing a stream is something one can use to make the stream ignore empty inputs: ``` #include <sstream> int main() { std::istringstream s; s.peek(); while (s && !s.eof()) { char c; s >> c; printf("not eof; read \'%c\' (%d)\n", c, c); } } ``` as discussed in https://github.com/llvm/llvm-project/pull/173754#discussion_r2669631585 this patch removes the `[[nodiscard]]` annotation.
Author
Parents
Loading