// // YaPB - Counter-Strike Bot based on PODBot by Markus Klinge. // Copyright © 2004-2021 YaPB Project . // // SPDX-License-Identifier: MIT // #pragma once #include CR_NAMESPACE_BEGIN namespace detail { template struct ClearRef { using Type = T; }; template struct ClearRef { using Type = T; }; template struct ClearRef { using Type = T; }; } template typename detail::ClearRef ::Type constexpr &&move (T &&type) noexcept { return static_cast ::Type &&> (type); } template constexpr T &&forward (typename detail::ClearRef ::Type &type) noexcept { return static_cast (type); } template constexpr T &&forward (typename detail::ClearRef ::Type &&type) noexcept { return static_cast (type); } template inline void swap (T &left, T &right) noexcept { auto temp = cr::move (left); left = cr::move (right); right = cr::move (temp); } template inline void swap (T (&left)[S], T (&right)[S]) noexcept { if (&left == &right) { return; } auto begin = left; auto end = begin + S; for (auto temp = right; begin != end; ++begin, ++temp) { cr::swap (*begin, *temp); } } CR_NAMESPACE_END