diff options
author | spreis <spreis@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
commit | b49848d6e361b76904f094b7d5e10d6edea75afe (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/binsaver/bin_saver.h | |
parent | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (diff) | |
download | ydb-b49848d6e361b76904f094b7d5e10d6edea75afe.tar.gz |
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/binsaver/bin_saver.h')
-rw-r--r-- | library/cpp/binsaver/bin_saver.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/binsaver/bin_saver.h b/library/cpp/binsaver/bin_saver.h index 69da5ad127..412424889f 100644 --- a/library/cpp/binsaver/bin_saver.h +++ b/library/cpp/binsaver/bin_saver.h @@ -30,18 +30,18 @@ enum ESaverMode { SAVER_MODE_WRITE_COMPRESSED = 3, }; -namespace NBinSaverInternals { - // This lets explicitly control the overload resolution priority - // The higher P means higher priority in overload resolution order - template <int P> - struct TOverloadPriority : TOverloadPriority <P-1> { - }; - - template <> - struct TOverloadPriority<0> { - }; -} - +namespace NBinSaverInternals { + // This lets explicitly control the overload resolution priority + // The higher P means higher priority in overload resolution order + template <int P> + struct TOverloadPriority : TOverloadPriority <P-1> { + }; + + template <> + struct TOverloadPriority<0> { + }; +} + ////////////////////////////////////////////////////////////////////////// struct IBinSaver { public: @@ -63,18 +63,18 @@ private: // } // }; template <class T, typename = decltype(std::declval<T*>()->T::operator&(std::declval<IBinSaver&>()))> - void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<2>) { // highest priority - will be resolved first if enabled + void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<2>) { // highest priority - will be resolved first if enabled // Note: p->operator &(*this) would lead to infinite recursion p->T::operator&(*this); } template <class T, typename = decltype(std::declval<T&>() & std::declval<IBinSaver&>())> - void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<1>) { // lower priority - will be resolved second if enabled + void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<1>) { // lower priority - will be resolved second if enabled (*p) & (*this); } template <class T> - void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<0>) { // lower priority - will be resolved last + void CallObjectSerialize(T* p, NBinSaverInternals::TOverloadPriority<0>) { // lower priority - will be resolved last #if (!defined(_MSC_VER)) // In MSVC __has_trivial_copy returns false to enums, primitive types and arrays. static_assert(__has_trivial_copy(T), "Class is nontrivial copyable, you must define operator&, see"); @@ -294,7 +294,7 @@ public: // return type of Add() is used to detect specialized serializer (see HasNonTrivialSerializer below) template <class T> char Add(const chunk_id, T* p) { - CallObjectSerialize(p, NBinSaverInternals::TOverloadPriority<2>()); + CallObjectSerialize(p, NBinSaverInternals::TOverloadPriority<2>()); return 0; } int Add(const chunk_id, std::string* pStr) { |