#pragma once #include #include #include namespace NYql::NPureCalc { class TProtoDestroyer { public: template static inline void Destroy(T* t) noexcept { if (t->GetArena() == nullptr) { CheckedDelete(t); } } }; template concept IsProtoMessage = std::is_base_of_v; template using TProtoHolder = THolder; template TProtoHolder MakeProtoHolder(NProtoBuf::Arena* arena, TArgs&&... args) { auto* ptr = NProtoBuf::Arena::CreateMessage(arena, std::forward(args)...); return TProtoHolder(ptr); } }