[libcxx-commits] [PATCH] D116815: [libc++] basic_string::resize_and_overwrite: Adopt LWG3645 (Not voted in yet)

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 14 13:37:15 PST 2022


Quuxplusone added inline comments.


================
Comment at: libcxx/include/string:985
       __resize_default_init(__n);
-      pointer __data = data();
-      __erase_to_end(_VSTD::move(__op)(__data, __n));
+      __erase_to_end(_VSTD::move(__op)(data(), +__n));
     }
----------------
ldionne wrote:
> WDYT about using `_LIBCPP_AUTO_CAST` here? It would be closest to the standard.
You mean
```
      __erase_to_end(_VSTD::move(__op)(data(), _LIBCPP_AUTO_CAST(__n)));
```
? I think that's heavier-weight (in terms of #includes and template instantiations) than `+__n`, but I don't object.
(We could do `_LIBCPP_AUTO_CAST(data())` too, but I //think// we both agree that'd be silly? :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116815



More information about the libcxx-commits mailing list