[libcxx-commits] [PATCH] D154454: [libc++] Implement istringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Piotr Fusik via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 4 11:26:18 PDT 2023


pfusik added inline comments.


================
Comment at: libcxx/include/sstream:863
+    template <class _SAlloc>
+      requires __is_allocator<_SAlloc>::value
+    _LIBCPP_HIDE_FROM_ABI basic_string<char_type, traits_type, _SAlloc> str(const _SAlloc& __sa) const {
----------------
Mordante wrote:
> This function is not constrained in the Standard. Why is it needed?
If we omit this constraint, we get:
```
call to member function 'str' is ambiguous
        ss.str(" 789");
```
I think the standard should include it.


================
Comment at: libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/mode.alloc.pass.cpp:27
+  const test_allocator<CharT> a(2);
+  const std::basic_istringstream<CharT, std::char_traits<CharT>, test_allocator<CharT>> ss(std::ios_base::in, a);
+  assert(ss.rdbuf()->get_allocator() == a);
----------------
Mordante wrote:
> I would avoid `std::ios_base::in` in these tests if possible. This should be automatically be set.
Why? What to use instead of `std::ios_base::in` ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154454/new/

https://reviews.llvm.org/D154454



More information about the libcxx-commits mailing list