aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.ru>2022-06-13 01:37:00 +0300
committerswarmer <swarmer@yandex-team.ru>2022-06-13 01:37:00 +0300
commite5e7d3b69b61a7855104d9eddb0b6ff02e7a2979 (patch)
tree355a99d6e7e7cdb5c269b105f15580e2de445bca /util/generic
parent669e8d5ef59e6f49667af117dfee9a43efbf2441 (diff)
downloadydb-e5e7d3b69b61a7855104d9eddb0b6ff02e7a2979.tar.gz
[enum_parser] generate ToStringBuf specialization
IGNIETFERRO-1350 ref:bb9bb1755b6abfc5a27639daf049b8a7cd748fe4
Diffstat (limited to 'util/generic')
-rw-r--r--util/generic/serialized_enum.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/generic/serialized_enum.h b/util/generic/serialized_enum.h
index 79df2bac22..8188c43eed 100644
--- a/util/generic/serialized_enum.h
+++ b/util/generic/serialized_enum.h
@@ -81,6 +81,14 @@ namespace NEnumSerializationRuntime {
*/
template <typename EnumT>
const TVector<TString>& GetEnumAllCppNamesImpl();
+
+ /**
+ * Converts @c e to a string. Works like @c ToString(e) function, but returns @c TStringBuf instead of @c TString.
+ * Thus works slightly faster and usually avoids any dynamic memory allocation.
+ * @throw yexception is case of unknown enum value
+ */
+ template <typename EnumT>
+ TStringBuf ToStringBuf(EnumT e);
}
/**