[libcxx-commits] [PATCH] D98573: [libc++] Remove most of the special logic for "noexcept iterators" in basic_string

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 14 20:09:22 PDT 2021


Quuxplusone updated this revision to Diff 330552.
Quuxplusone added a comment.

> Not if you have already reallocated the string and invalidated existing pointers and iterators.

Yikes!! Yes, you're right. I've added a new regression test for `append` (which fails before this patch, and also failed with the previous iteration of this patch). Am I adding too many epicycles to `append`? Should we just do the libstdc++ thing and make these functions always allocate a temporary string? Perhaps "anybody who cares that much about performance should just use the pointer+length overloads of these methods, not the arbitrary-input-iterator overloads"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98573

Files:
  libcxx/include/filesystem
  libcxx/include/string
  libcxx/test/libcxx/strings/iterators.exceptions.pass.cpp
  libcxx/test/libcxx/strings/iterators.noexcept.pass.cpp
  libcxx/test/std/strings/basic.string/string.modifiers/string_append/strong_guarantee.pass.cpp
  libcxx/test/std/strings/basic.string/string.modifiers/string_insert/strong_guarantee.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98573.330552.patch
Type: text/x-patch
Size: 26205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210315/c984b8f8/attachment-0001.bin>


More information about the libcxx-commits mailing list