[libc-commits] [libc] [libc] Add front() and erase() to FixedVector (PR #213866)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Wed Aug 5 01:12:33 PDT 2026


================
@@ -75,6 +85,14 @@ template <typename T, size_t CAPACITY> class FixedVector {
     return true;
   }
 
+  LIBC_INLINE constexpr iterator erase(iterator pos) {
+    LIBC_ASSERT(pos >= begin() && pos < end());
+    for (iterator it = pos; it + 1 != end(); ++it)
+      *it = *(it + 1);
----------------
kaladron wrote:

```suggestion
      *it = LIBC_NAMESPACE::cpp::move(*(it + 1));
```

https://github.com/llvm/llvm-project/pull/213866


More information about the libc-commits mailing list