Sprout/sprout/utility/forward.hpp
bolero-MURAKAMI e11c2eb867 sprout/utility/move.hpp 追加
tuple に要素数の異なるタプルからの暗黙の変換を追加
2011-11-03 13:15:21 +09:00

19 lines
520 B
C++

#ifndef SPROUT_UTILITY_FORWARD_HPP
#define SPROUT_UTILITY_FORWARD_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// forward
//
template<typename T>
SPROUT_CONSTEXPR T&& forward(typename std::remove_reference<T>::type& t) SPROUT_NOEXCEPT {
return static_cast<T&&>(t);
}
template<typename T>
SPROUT_CONSTEXPR T&& forward(typename std::remove_reference<T>::type&& t) SPROUT_NOEXCEPT = delete;
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_FORWARD_HPP