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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 9 08:44:20 PDT 2023


philnik added inline comments.


================
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) {
----------------
pfusik wrote:
> 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`. 
`_LIBCPP_BUILDING_LIBRARY` is defined when building the static or shared library. It's not required for `string::substr`, because that's not part of the library. `stringbuf::str()` OTOH is part of the library through an extern template.


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