In certain cases, it is useful to share submessages across multiple parent messages. proto2::cpp has a mechanism for this, so we add the hpb equivalent. For this initial impl, we stipulate that the arenas must be exactly the same. We may explore broadening the constraint to allow for all fused arenas. PiperOrigin-RevId: 681169537pull/18562/head
parent
77ee83b8da
commit
1db4fdc236
5 changed files with 67 additions and 1 deletions
@ -0,0 +1,19 @@ |
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2024 Google LLC. All rights reserved. |
||||
// |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file or at |
||||
// https://developers.google.com/open-source/licenses/bsd |
||||
|
||||
syntax = "proto2"; |
||||
|
||||
package hpb_unittest; |
||||
|
||||
message Child { |
||||
optional int32 peeps = 1; |
||||
} |
||||
|
||||
message Parent { |
||||
optional int32 x = 1; |
||||
optional Child child = 2; |
||||
} |
Loading…
Reference in new issue