cymove 1.0.2

Creator: bigcodingguy24

Last updated:

Add to Cart

Description:

cymove 1.0.2

cymove

This package is DEPRECATED since std::move support is merged to Cython and available as of v0.29.17 (2020-04-26).
cymove is a header (pxd) only wrapper around C++11 std::move function. It
allows using move semantics from cython code.
Installation
pip install cymove

Example Usage
example.pyx:
# distutils: language = c++

from libcpp.memory cimport make_shared, shared_ptr, nullptr
from cymove cimport cymove as move

cdef shared_ptr[int] ptr1, ptr2
cdef int* raw_ptr

ptr1 = make_shared[int](5)
raw_ptr = ptr1.get()
ptr2 = move(ptr1)

assert ptr2.get() == raw_ptr
assert ptr1 == nullptr

print("OK!")

Compile & run:
$ cythonize -3 -i example.pyx
$ python3 -c "import example"
OK!

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.