1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

sprout/utility/move.hpp 追加

tuple に要素数の異なるタプルからの暗黙の変換を追加
This commit is contained in:
bolero-MURAKAMI 2011-11-03 13:15:21 +09:00
parent 40036a4c05
commit e11c2eb867
5 changed files with 74 additions and 16 deletions

View file

@ -17,4 +17,3 @@ namespace sprout {
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_FORWARD_HPP

17
sprout/utility/move.hpp Normal file
View file

@ -0,0 +1,17 @@
#ifndef SPROUT_UTILITY_MOVE_HPP
#define SPROUT_UTILITY_MOVE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// move
//
template<typename T>
SPROUT_CONSTEXPR typename std::remove_reference<T>::type&& move(T&& t) SPROUT_NOEXCEPT {
return static_cast<typename std::remove_reference<T>::type&&>(t);
}
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_MOVE_HPP

View file

@ -0,0 +1,8 @@
#ifndef SPROUT_UTILITY_OPERATION_HPP
#define SPROUT_UTILITY_OPERATION_HPP
#include <sprout/config.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/move.hpp>
#endif // #ifndef SPROUT_UTILITY_OPERATION_HPP