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
pull/11821/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent fe0d593777
commit 4bf33da229
  1. 8
      src/google/protobuf/repeated_ptr_field.h

@ -1183,6 +1183,9 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
iterator erase(const_iterator first, const_iterator last);
// Gets the arena on which this RepeatedPtrField stores its elements.
inline Arena* GetArena();
ABSL_DEPRECATED("This will be removed in a future release")
inline Arena* GetArena() const;
// For internal use only.
@ -1544,6 +1547,11 @@ inline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
RepeatedPtrFieldBase::SwapElements(index1, index2);
}
template <typename Element>
inline Arena* RepeatedPtrField<Element>::GetArena() {
return RepeatedPtrFieldBase::GetArena();
}
template <typename Element>
inline Arena* RepeatedPtrField<Element>::GetArena() const {
return RepeatedPtrFieldBase::GetArena();

Loading…
Cancel
Save