[libcxx-commits] [PATCH] D148641: [libc++] Add C++20 stringstream::view()

Piotr Fusik via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 8 03:36:10 PDT 2023


pfusik added inline comments.


================
Comment at: libcxx/include/sstream:512
+{
+    if (__mode_ & ios_base::out)
+    {
----------------
Mordante wrote:
> Mordante wrote:
> > It seems the tests only validate this code path. The `basic_stringbuf` is always uses the default `which` argument. I assume the same issue applies to the original tests you copied. It would be great to improve these tests too in a separate review.
> The same applies for the `_Traits` argument, it's only tested for the default traits. We don't have specific `char_traits` in our test frame-work but you can probably do something like
> 
> ```
> template <class CharT>
> struct my_char_traits : public char_traits<CharT> {};
> ```
> and use these traits.
> 
> Nowadays we try to have more extensive tests then we used to have in the past so that's why the `str()` tests are as they are.
> 
> 
`istringstream` exercises the second path. I now added testing the second and third path in the `stringbuf` test.


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