// // Yet Another POD-Bot, based on PODBot by Markus Klinge ("CountFloyd"). // Copyright (c) Yet Another POD-Bot Contributors . // // This software is licensed under the MIT license. // Additional exceptions apply. For full license details, see LICENSE.txt // #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