From 296b7cdeb9c5da23e1100e1752e43c1b515071be Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 18 Apr 2015 00:11:16 +0100 Subject: [PATCH] move move/forward to utility.h --- octa/range.h | 2 +- octa/traits.h | 22 ---------------------- octa/utility.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/octa/range.h b/octa/range.h index d004740..1ec3e3f 100644 --- a/octa/range.h +++ b/octa/range.h @@ -9,7 +9,7 @@ #include #include "octa/types.h" -#include "octa/traits.h" +#include "octa/utility.h" namespace octa { struct InputRange {}; diff --git a/octa/traits.h b/octa/traits.h index 201706d..99f2949 100644 --- a/octa/traits.h +++ b/octa/traits.h @@ -165,28 +165,6 @@ namespace octa { template struct IsArray : false_t {}; template struct IsArray: true_t {}; template struct IsArray: true_t {}; - - /* move */ - - template - static inline constexpr typename RemoveReference::type && - move(T &&v) noexcept { - return static_cast::type &&>(v); - } - - /* forward */ - - template - static inline constexpr T && - forward(typename RemoveReference::type &v) noexcept { - return static_cast(v); - } - - template - static inline constexpr T && - forward(typename RemoveReference::type &&v) noexcept { - return static_cast(v); - } } #endif \ No newline at end of file diff --git a/octa/utility.h b/octa/utility.h index 6e28e58..6960070 100644 --- a/octa/utility.h +++ b/octa/utility.h @@ -50,6 +50,24 @@ namespace octa { swap(a[i], b[i]); } } + + template + static inline constexpr typename RemoveReference::type && + move(T &&v) noexcept { + return static_cast::type &&>(v); + } + + template + static inline constexpr T && + forward(typename RemoveReference::type &v) noexcept { + return static_cast(v); + } + + template + static inline constexpr T && + forward(typename RemoveReference::type &&v) noexcept { + return static_cast(v); + } } #endif \ No newline at end of file