add pass_through utility function

This commit is contained in:
bolero-MURAKAMI 2014-05-06 18:10:06 +09:00
parent 3c4a048f25
commit e593f87559
3 changed files with 25 additions and 1 deletions

View file

@ -13,7 +13,6 @@
#include <sprout/operation/append_back.hpp>
#include <sprout/integer/static_pow.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/workaround/std/cstddef.hpp>
//
// hanoi

View file

@ -13,6 +13,7 @@
#include <sprout/utility/as_lvalue.hpp>
#include <sprout/utility/as_const.hpp>
#include <sprout/utility/lvalue_forward.hpp>
#include <sprout/utility/pass_through.hpp>
#include <sprout/utility/limited.hpp>
#endif // #ifndef SPROUT_UTILITY_OPERATION_EXT_HPP

View file

@ -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 <sprout/config.hpp>
namespace sprout {
//
// pass_through
//
template<typename T>
constexpr T&&
pass_through(T&& t) {
return static_cast<T&&>(t);
}
} // namespace sprout
#endif // #ifndef SPROUT_MATH_ACOS_HPP