Change the arena.hpp ::Fuse return type to bool to surface whether the fuse failed.

PiperOrigin-RevId: 628161481
pull/16642/head
Protobuf Team Bot 2024-04-25 12:46:17 -07:00 committed by Copybara-Service
parent 419824d26b
commit 62f2b143d5
1 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,11 @@ class Arena {
upb_Arena* ptr() const { return ptr_.get(); }
void Fuse(Arena& other) { upb_Arena_Fuse(ptr(), other.ptr()); }
// Fuses the arenas together.
// This operation can only be performed on arenas with no initial blocks. Will
// return false if the fuse failed due to either arena having an initial
// block.
bool Fuse(Arena& other) { return upb_Arena_Fuse(ptr(), other.ptr()); }
protected:
std::unique_ptr<upb_Arena, decltype(&upb_Arena_Free)> ptr_;