add shrink_to_fit, unmove

This commit is contained in:
bolero-MURAKAMI 2014-07-22 09:33:13 +09:00
parent 22c3f6e132
commit ae77da19e1
12 changed files with 192 additions and 45 deletions

22
sprout/utility/unmove.hpp Normal file
View file

@ -0,0 +1,22 @@
/*=============================================================================
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_UNMOVE_HPP
#define SPROUT_UTILITY_UNMOVE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
template<typename T>
inline SPROUT_CONSTEXPR typename std::remove_reference<T>::type&
unmove(T&& x) SPROUT_NOEXCEPT {
return static_cast<typename std::remove_reference<T>::type&>(x);
}
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_UNMOVE_HPP