diff options
author | tender-bum <tender-bum@yandex-team.ru> | 2022-02-10 16:50:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:01 +0300 |
commit | 4aef354b224559d2b031487a10d4f5cc6e82e95a (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/utility.h | |
parent | c78b06a63de7beec995c1007bc5332bdf3d75b69 (diff) | |
download | ydb-4aef354b224559d2b031487a10d4f5cc6e82e95a.tar.gz |
Restoring authorship annotation for <tender-bum@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/utility.h')
-rw-r--r-- | util/generic/utility.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/util/generic/utility.h b/util/generic/utility.h index 75f63400d7..43b98eeafc 100644 --- a/util/generic/utility.h +++ b/util/generic/utility.h @@ -69,27 +69,27 @@ namespace NSwapCheck { Y_HAS_MEMBER(swap); Y_HAS_MEMBER(Swap); - template <class T, class = void> - struct TSwapSelector { - static inline void Swap(T& l, T& r) noexcept(std::is_nothrow_move_constructible<T>::value&& - std::is_nothrow_move_assignable<T>::value) { - T tmp(std::move(l)); - l = std::move(r); - r = std::move(tmp); + template <class T, class = void> + struct TSwapSelector { + static inline void Swap(T& l, T& r) noexcept(std::is_nothrow_move_constructible<T>::value&& + std::is_nothrow_move_assignable<T>::value) { + T tmp(std::move(l)); + l = std::move(r); + r = std::move(tmp); } }; - template <class T> - struct TSwapSelector<T, std::enable_if_t<THasSwap<T>::value>> { - static inline void Swap(T& l, T& r) noexcept(noexcept(l.Swap(r))) { - l.Swap(r); + template <class T> + struct TSwapSelector<T, std::enable_if_t<THasSwap<T>::value>> { + static inline void Swap(T& l, T& r) noexcept(noexcept(l.Swap(r))) { + l.Swap(r); } }; - template <class T> - struct TSwapSelector<T, std::enable_if_t<THasswap<T>::value && !THasSwap<T>::value>> { - static inline void Swap(T& l, T& r) noexcept(noexcept(l.swap(r))) { - l.swap(r); + template <class T> + struct TSwapSelector<T, std::enable_if_t<THasswap<T>::value && !THasSwap<T>::value>> { + static inline void Swap(T& l, T& r) noexcept(noexcept(l.swap(r))) { + l.swap(r); } }; } @@ -98,7 +98,7 @@ namespace NSwapCheck { * DoSwap better than ::Swap in member functions... */ template <class T> -static inline void DoSwap(T& l, T& r) noexcept(noexcept(NSwapCheck::TSwapSelector<T>::Swap(l, r))) { +static inline void DoSwap(T& l, T& r) noexcept(noexcept(NSwapCheck::TSwapSelector<T>::Swap(l, r))) { NSwapCheck::TSwapSelector<T>::Swap(l, r); } |