[libcxx-commits] [PATCH] D133560: split `<istream>` header

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 11 04:39:39 PDT 2022


huixie90 created this revision.
Herald added a subscriber: mgorny.
Herald added a project: All.
huixie90 updated this revision to Diff 459035.
huixie90 added a comment.
huixie90 updated this revision to Diff 459086.
huixie90 updated this revision to Diff 459304.
huixie90 edited the summary of this revision.
huixie90 added reviewers: philnik, var-const, ldionne.
huixie90 published this revision for review.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

CI


huixie90 added a comment.

ci


huixie90 added a comment.

CI


`<istream>` defines `basic_istream` and `basic_iostream`. The `basic_iostream` brings all the dependencies to `<ostream>`.
While implementing `<ranges>`'s `std::views::istream`, we need the declaration of `basic_istream` and all its member `>>` and free `>>`,
because the concept checks the validity of `>>`. To avoid adding too many dependencies to `<ranges>`, it would be good idea to split
`basic_istream` and `basic_iostream`. Also, we only need the declarations of `>>` to pass the concept check, we don't need the extra
dependencies coming from the implementations, namely `<locale>` and its indirect dependencies (`__locale` isn't enough). Luckily, the `basic_istream`'s member definition is out of line, so there is not much work to do
other than split the files. Also there is not much SFINAE going so keeping declaration and definition separate won't cause too much code duplication


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133560

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__istream/basic_iostream.h
  libcxx/include/__istream/basic_istream.h
  libcxx/include/__istream/basic_istream_def.h
  libcxx/include/istream
  libcxx/include/module.modulemap.in
  libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
  libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
  libcxx/test/libcxx/private_headers.verify.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133560.459304.patch
Type: text/x-patch
Size: 84847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220911/229e16d4/attachment-0001.bin>


More information about the libcxx-commits mailing list