[libc++][istream] P3223R2: Making std::istream::ignore less surprising by H-G-Hristov · Pull Request #147007 · llvm/llvm-project (original) (raw)

@llvm/pr-subscribers-libcxx

Author: Hristo Hristov (H-G-Hristov)

Changes

Implements P3223R2

References


Full diff: https://github.com/llvm/llvm-project/pull/147007.diff

4 Files Affected:

diff --git a/libcxx/docs/ReleaseNotes/21.rst b/libcxx/docs/ReleaseNotes/21.rst index 08b32bb508dc1..34735ca515d53 100644 --- a/libcxx/docs/ReleaseNotes/21.rst +++ b/libcxx/docs/ReleaseNotes/21.rst @@ -51,6 +51,7 @@ Implemented Papers - P2441R2: views::join_with (Github <https://github.com/llvm/llvm-project/issues/105185>) - P2711R1: Making multi-param constructors of views explicit (Github <https://github.com/llvm/llvm-project/issues/105252>) - P2770R0: Stashing stashing iterators for proper flattening (Github <https://github.com/llvm/llvm-project/issues/105250>__) +- P3223R2: Making std::istream::ignore less surprising Improvements and New Features

diff --git a/libcxx/include/istream b/libcxx/include/istream index 02546902494e3..83ba1799cae91 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -70,6 +70,7 @@ public: basic_istream& getline(char_type* s, streamsize n, char_type delim);

 basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());

include <__type_traits/conjunction.h>

include <__type_traits/enable_if.h>

include <__type_traits/is_base_of.h>

+# include <__type_traits/is_same.h>

include <__type_traits/make_unsigned.h>

include <__utility/declval.h>

include <__utility/forward.h>

@@ -291,6 +293,13 @@ public: basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);

basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof()); +# if _LIBCPP_STD_VER >= 26

+#include +#include + +#include "test_macros.h" + +int main(int, char**) {

+#include +#include + +#include "test_macros.h" + +void test() {