[libcxx-commits] [PATCH] D151896: [libc++] Implement C++20 P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Piotr Fusik via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 9 01:48:01 PDT 2023


pfusik marked 2 inline comments as done.
pfusik added inline comments.


================
Comment at: libcxx/include/sstream:374-375
+    void swap(basic_stringbuf& __rhs)
+        _NOEXCEPT_(allocator_traits<allocator_type>::propagate_on_container_swap::value ||
+                   allocator_traits<allocator_type>::is_always_equal::value);
 
----------------
philnik wrote:
> Why do you add a conditional noexcept without any guards here?
Fixed.


================
Comment at: libcxx/include/sstream:378
     // [stringbuf.members] Member functions:
-    string_type str() const;
-    void str(const string_type& __s);
+    string_type str() const _LIBCPP_REF_SINCE_CXX20;
+    void str(const string_type& __s) {
----------------
philnik wrote:
> Otherwise this is super confusing IMO. The extra bits should fix your problem.
This doesn't look right: the `&` should be in C++20. What's `_LIBCPP_BUILDING_LIBRARY` ?

It looks similar to `std::string::substr` which doesn't use `_LIBCPP_BUILDING_LIBRARY`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151896



More information about the libcxx-commits mailing list