#pragma once #include #include namespace NUnifiedAgent { namespace NPrivate { using TEnumNames = TVector; template TEnumNames BuildEnumNames() { const auto names = GetEnumNames(); auto result = TEnumNames(names.size()); size_t index = 0; for (const auto& p: names) { Y_VERIFY(static_cast(p.first) == index); result[index++] = &p.second; } return result; } template inline const auto EnumNames = BuildEnumNames(); } template >> inline const TString& NameOf(TEnum val) noexcept { return *NPrivate::EnumNames[static_cast(val)]; } }