diff options
author | say <say@yandex-team.ru> | 2022-02-10 16:48:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:19 +0300 |
commit | 2096e85a73bb6b3b20ae25a92943992717fe4167 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/ysaveload.h | |
parent | a6a6f6e1e77c7d7d0cdfad61c093e061d6fb5782 (diff) | |
download | ydb-2096e85a73bb6b3b20ae25a92943992717fe4167.tar.gz |
Restoring authorship annotation for <say@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/ysaveload.h')
-rw-r--r-- | util/ysaveload.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/util/ysaveload.h b/util/ysaveload.h index b41922b336..02efb4049b 100644 --- a/util/ysaveload.h +++ b/util/ysaveload.h @@ -421,7 +421,7 @@ public: }; template <class T> -struct TTupleSerializer { +struct TTupleSerializer { template <class F, class Tuple, size_t... Indices> static inline void ReverseUseless(F&& f, Tuple&& t, std::index_sequence<Indices...>) { ApplyToMany( @@ -429,23 +429,23 @@ struct TTupleSerializer { // We need to do this trick because we don't want to break backward compatibility. // Tuples are being packed in reverse order. std::get<std::tuple_size<T>::value - Indices - 1>(std::forward<Tuple>(t))...); - } - + } + static inline void Save(IOutputStream* stream, const T& t) { ReverseUseless([&](const auto& v) { ::Save(stream, v); }, t, std::make_index_sequence<std::tuple_size<T>::value>{}); - } - + } + static inline void Load(IInputStream* stream, T& t) { ReverseUseless([&](auto& v) { ::Load(stream, v); }, t, std::make_index_sequence<std::tuple_size<T>::value>{}); - } -}; - -template <typename... TArgs> + } +}; + +template <typename... TArgs> struct TSerializer<std::tuple<TArgs...>>: TTupleSerializer<std::tuple<TArgs...>> { -}; - +}; + template <> class TSerializer<TBuffer> { public: |