From e593f875596a86a93cc54b3ac18b88e146b310b1 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Tue, 6 May 2014 18:10:06 +0900 Subject: [PATCH] add pass_through utility function --- example/hanoi/main.cpp | 1 - sprout/utility/operation_ext.hpp | 1 + sprout/utility/pass_through.hpp | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 sprout/utility/pass_through.hpp diff --git a/example/hanoi/main.cpp b/example/hanoi/main.cpp index 4637fb60..f56219ac 100644 --- a/example/hanoi/main.cpp +++ b/example/hanoi/main.cpp @@ -13,7 +13,6 @@ #include #include #include -#include // // hanoi diff --git a/sprout/utility/operation_ext.hpp b/sprout/utility/operation_ext.hpp index dda2f607..4e1cd07d 100644 --- a/sprout/utility/operation_ext.hpp +++ b/sprout/utility/operation_ext.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #endif // #ifndef SPROUT_UTILITY_OPERATION_EXT_HPP diff --git a/sprout/utility/pass_through.hpp b/sprout/utility/pass_through.hpp new file mode 100644 index 00000000..b18ad0be --- /dev/null +++ b/sprout/utility/pass_through.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2011-2014 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_UTILITY_PASS_THROUGH_HPP +#define SPROUT_UTILITY_PASS_THROUGH_HPP + +#include + +namespace sprout { + // + // pass_through + // + template + constexpr T&& + pass_through(T&& t) { + return static_cast(t); + } +} // namespace sprout + +#endif // #ifndef SPROUT_MATH_ACOS_HPP