[libcxx-commits] [PATCH] D148641: [libc++] Add C++20 stringstream::view()
Piotr Fusik via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 4 02:24:28 PDT 2023
pfusik marked 3 inline comments as done.
pfusik added inline comments.
================
Comment at: libcxx/include/sstream:492
+basic_string_view<_CharT, _Traits>
+basic_stringbuf<_CharT, _Traits, _Allocator>::view() const noexcept
+{
----------------
Mordante wrote:
> pfusik wrote:
> > Mordante wrote:
> > > Please format the new code with clang-format so it matches our "normal" style.
> > How do I do that?
> You can use git clang-format like `git clang-format-16 HEAD^` this formats the changes in the last commit.
fox at wiesmac llvm-project % git clang-format HEAD^
clang-format did not modify any files
================
Comment at: libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/view.pass.cpp:24
+static std::string_view get_view(const std::istringstream& ss) noexcept { return ss.view(); }
+
+int main(int, char**) {
----------------
Mordante wrote:
> Using something along these lines avoid some code duplication. This also makes it easier to adapt the tests if we can use `basic_stringstream` with other character types like `char8_t`.
Now I support your original claim that tests should be simple. There's not much duplication here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148641/new/
https://reviews.llvm.org/D148641
More information about the libcxx-commits
mailing list