summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmer Ozarslan <omer@utdallas.edu>2020-02-15 16:56:30 -0600
committerStefan Behnel <stefan_ml@behnel.de>2020-04-07 21:07:00 +0200
commit097e2be1dfc208f29f1954db706b8fb396dd0b4d (patch)
tree0bfcbc3073524418b74386d3739d44bc7cc10456
parentafb6256a35fa4471f815e69e509a594fc44c6291 (diff)
downloadcython-097e2be1dfc208f29f1954db706b8fb396dd0b4d.tar.gz
Add std::move wrapper to utility library
-rw-r--r--Cython/Includes/libcpp/utility.pxd14
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)