Skip to content

Commit 4bf33da

Browse files
Add a non-const overload of RepeatedPtrField::GetArena and deprecate the const overload.
Motivation: we are planning to make RepeatedPtrField::GetArena non-const in order to support split RepeatedFields. PiperOrigin-RevId: 507528755
1 parent fe0d593 commit 4bf33da

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/google/protobuf/repeated_ptr_field.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,9 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
11831183
iterator erase(const_iterator first, const_iterator last);
11841184

11851185
// Gets the arena on which this RepeatedPtrField stores its elements.
1186+
inline Arena* GetArena();
1187+
1188+
ABSL_DEPRECATED("This will be removed in a future release")
11861189
inline Arena* GetArena() const;
11871190

11881191
// For internal use only.
@@ -1544,6 +1547,11 @@ inline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
15441547
RepeatedPtrFieldBase::SwapElements(index1, index2);
15451548
}
15461549

1550+
template <typename Element>
1551+
inline Arena* RepeatedPtrField<Element>::GetArena() {
1552+
return RepeatedPtrFieldBase::GetArena();
1553+
}
1554+
15471555
template <typename Element>
15481556
inline Arena* RepeatedPtrField<Element>::GetArena() const {
15491557
return RepeatedPtrFieldBase::GetArena();

0 commit comments

Comments
 (0)