From 30dbbc44fc85cb0882badd3b1da289b4571218d6 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 7 Apr 2012 22:36:12 +0900 Subject: [PATCH] add lvalue_forward.hpp --- sprout/utility/lvalue_forward.hpp | 24 ++++++++++++++++++++++++ sprout/utility/operation_ext.hpp | 1 + 2 files changed, 25 insertions(+) create mode 100644 sprout/utility/lvalue_forward.hpp diff --git a/sprout/utility/lvalue_forward.hpp b/sprout/utility/lvalue_forward.hpp new file mode 100644 index 00000000..236212f6 --- /dev/null +++ b/sprout/utility/lvalue_forward.hpp @@ -0,0 +1,24 @@ +#ifndef SPROUT_UTILITY_LVALUE_FORWARD_HPP +#define SPROUT_UTILITY_LVALUE_FORWARD_HPP + +#include +#include +#include +#include +#include + +namespace sprout { + // + // lvalue_forward + // + template + inline SPROUT_CONSTEXPR typename sprout::lvalue_reference::type + lvalue_forward(typename std::remove_reference::type& t) { + return sprout::as_lvalue(sprout::forward(t)); + } + template + inline SPROUT_CONSTEXPR typename sprout::lvalue_reference::type + lvalue_forward(typename std::remove_reference::type&& t) = delete; +} // namespace sprout + +#endif // #ifndef SPROUT_UTILITY_LVALUE_FORWARD_HPP diff --git a/sprout/utility/operation_ext.hpp b/sprout/utility/operation_ext.hpp index ad064555..924d4edf 100644 --- a/sprout/utility/operation_ext.hpp +++ b/sprout/utility/operation_ext.hpp @@ -4,5 +4,6 @@ #include #include #include +#include #endif // #ifndef SPROUT_UTILITY_OPERATION_EXT_HPP