[llvm] [Support] add vector::erase to JSON::Array (PR #168835)

Erick Velez via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 22:53:15 PST 2025


https://github.com/evelez7 created https://github.com/llvm/llvm-project/pull/168835

None

>From 27b71d153c926dd937eb2dc5b5cfc427fc479195 Mon Sep 17 00:00:00 2001
From: Erick Velez <erickvelez7 at gmail.com>
Date: Wed, 19 Nov 2025 22:22:02 -0800
Subject: [PATCH] [Support] add vector::erase to JSON::Array

---
 llvm/include/llvm/Support/JSON.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index 37baa7b45e4eb..a58332c912942 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -205,6 +205,7 @@ class Array {
   iterator insert(const_iterator P, Value &&E);
   template <typename It> iterator insert(const_iterator P, It A, It Z);
   template <typename... Args> iterator emplace(const_iterator P, Args &&...A);
+  iterator erase(const_iterator P);
 
   friend bool operator==(const Array &L, const Array &R);
 };
@@ -579,6 +580,7 @@ template <typename... Args>
 inline Array::iterator Array::emplace(const_iterator P, Args &&...A) {
   return V.emplace(P, std::forward<Args>(A)...);
 }
+inline Array::iterator Array::erase(const_iterator P) { return V.erase(P); }
 inline bool operator==(const Array &L, const Array &R) { return L.V == R.V; }
 
 /// ObjectKey is a used to capture keys in Object. Like Value but:



More information about the llvm-commits mailing list