mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
add shrink_to_fit, unmove
This commit is contained in:
parent
22c3f6e132
commit
ae77da19e1
12 changed files with 192 additions and 45 deletions
22
sprout/utility/unmove.hpp
Normal file
22
sprout/utility/unmove.hpp
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue