aboutsummaryrefslogtreecommitdiffstats
path: root/util/ysaveload.h
diff options
context:
space:
mode:
authorishfb <ishfb@yandex-team.ru>2022-02-10 16:48:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:08 +0300
commit069c69f58fd78de3cf2e6eb2304047281e21fb65 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/ysaveload.h
parent0170772a2dbf133f32e17ca137ff64790d43831f (diff)
downloadydb-069c69f58fd78de3cf2e6eb2304047281e21fb65.tar.gz
Restoring authorship annotation for <ishfb@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/ysaveload.h')
-rw-r--r--util/ysaveload.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/ysaveload.h b/util/ysaveload.h
index 4941ffbc3e..02efb4049b 100644
--- a/util/ysaveload.h
+++ b/util/ysaveload.h
@@ -650,27 +650,27 @@ namespace NPrivate {
}
}
-template <typename... Args>
+template <typename... Args>
struct TSerializer<std::variant<Args...>> {
using TVar = std::variant<Args...>;
-
- static_assert(sizeof...(Args) < 256, "We use ui8 to store tag");
-
- static void Save(IOutputStream* os, const TVar& v) {
+
+ static_assert(sizeof...(Args) < 256, "We use ui8 to store tag");
+
+ static void Save(IOutputStream* os, const TVar& v) {
::Save<ui8>(os, v.index());
std::visit([os](const auto& data) {
- ::Save(os, data);
+ ::Save(os, data);
}, v);
- }
-
- static void Load(IInputStream* is, TVar& v) {
+ }
+
+ static void Load(IInputStream* is, TVar& v) {
ui8 index;
::Load(is, index);
if (Y_UNLIKELY(index >= sizeof...(Args))) {
::NPrivate::ThrowUnexpectedVariantTagException(index);
}
LoadImpl(is, v, index, std::index_sequence_for<Args...>{});
- }
+ }
private:
template <size_t... Is>
@@ -679,8 +679,8 @@ private:
constexpr TLoader loaders[] = {::NPrivate::LoadVariantAlternative<TVar, Args, Is>...};
loaders[index](is, v);
}
-};
-
+};
+
#endif
template <class T>