[libcxx-commits] [PATCH] D73743: Inline basic_string::erase for fastpath where __n == npos

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 24 12:20:16 PST 2020


EricWF added inline comments.


================
Comment at: libcxx/include/string:1579
+    // `n ~= npos`, likely requiring memory moves on the string data.
+    void __erase_with_move(size_type __pos, size_type __n);
+
----------------
Nit: I was fond of using `external` to denote that a function was designed as such.


================
Comment at: libcxx/include/string:3008
+void
+basic_string<_CharT, _Traits, _Allocator>::__erase_with_move(size_type __pos, size_type __n)
 {
----------------
I don't think any operation in this function can throw. Should we mark it noexcept?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73743





More information about the libcxx-commits mailing list