diff options
| author | tender-bum <[email protected]> | 2022-02-10 16:50:01 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:01 +0300 |
| commit | c78b06a63de7beec995c1007bc5332bdf3d75b69 (patch) | |
| tree | 729de992758f40b85278d4abaad655be5dd68dbc /util/generic/utility.h | |
| parent | 95ab23a39b5482a434361566cabdd5b0a433cb43 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 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 43b98eeafc7..75f63400d7a 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); } |
