[libcxx-commits] [PATCH] D113013: [libc++] Implement P1072R10 (std::basic_string::resize_and_overwrite)

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Nov 13 07:53:14 PST 2021


Quuxplusone added subscribers: ckennelly, mzeren-vmw.
Quuxplusone added inline comments.


================
Comment at: libcxx/include/string:997
+      __resize_default_init(__n);
+      auto __data = data();
+      __erase_to_end(_VSTD::move(__op)(__data, __n));
----------------
Mordante wrote:
> Quuxplusone wrote:
> > Mordante wrote:
> > > Is there a reason to use variable instead of calling `data()` in `__erase_to_end`.
> > > The LLVM coding convention doesn't like `auto` when the type isn't clear.
> > Sadly yes, `OP`'s parameters are overspecified as lvalues, not prvalues. I've just requested an LWG issue number for this.
> > https://eel.is/c++draft/basic.string#string.capacity-7
> In that case once you have a number, can you provide it here. Then we can add a comment why this is required. (And clean it up once the issue is resolved.)
@mzeren-vmw @ckennelly (paper authors), thoughts? Shall we even just go ahead and do the sane thing here, on the assumption that LWG will catch up to us? :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113013



More information about the libcxx-commits mailing list