SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 35 C++

Mark mutable repeated fields/maps as [[nodiscard]]

Since these fields have implicit presence, these are no-ops if the returned
pointer is unused.  These are logically constant, but named "mutable_..." and
are non-const methods of the class in order to return the non-const references.
Ignoring the return value likely indicates an omission on the part of the
caller, an error by confusing it with explicit presence fields (like scalar
submessages or strings), or a call that can be cleaned up.

PiperOrigin-RevId: 839401150
C
Chris Kennelly committed
bc60e2e8077867eaf9bcc65e42d6d36a7a959a5d
Parent: 9a50829
Committed by Copybara-Service <copybara-worker@google.com> on 12/2/2025, 9:23:51 PM