diff options
author | Omer Ozarslan <omer@utdallas.edu> | 2020-02-15 16:56:30 -0600 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-07 21:07:00 +0200 |
commit | 097e2be1dfc208f29f1954db706b8fb396dd0b4d (patch) | |
tree | 0bfcbc3073524418b74386d3739d44bc7cc10456 | |
parent | afb6256a35fa4471f815e69e509a594fc44c6291 (diff) | |
download | cython-097e2be1dfc208f29f1954db706b8fb396dd0b4d.tar.gz |
Add std::move wrapper to utility library
-rw-r--r-- | Cython/Includes/libcpp/utility.pxd | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Cython/Includes/libcpp/utility.pxd b/Cython/Includes/libcpp/utility.pxd index ab649fe7a..ec8ba4018 100644 --- a/Cython/Includes/libcpp/utility.pxd +++ b/Cython/Includes/libcpp/utility.pxd @@ -13,3 +13,17 @@ cdef extern from "<utility>" namespace "std" nogil: bint operator>(pair&, pair&) bint operator<=(pair&, pair&) bint operator>=(pair&, pair&) + +cdef extern from * namespace "cython_std" nogil: + """ + #if __cplusplus > 199711L + #include <type_traits> + + namespace cython_std { + template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); } + template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); } + } + + #endif + """ + cdef T move[T](T) |