std::move wrapper for cython
Project description
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cymove-1.0.2.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file cymove-1.0.2.tar.gz
.
File metadata
- Download URL: cymove-1.0.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c1350db2f1f92a459b87ee9072ec0790faab233bfaeb73bf78a5caadd5aaa8 |
|
MD5 | 2fd7e03a5c5f44361c52a302b5829e08 |
|
BLAKE2b-256 | bb42064fb406ad6ac8e330f222a1d2341f3668b9b038ebbe3177cce017e1f035 |
File details
Details for the file cymove-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: cymove-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4bd59e0e6f99eb2fb9e6b443c84148061de4841fb6026ac724c9b9944a3056 |
|
MD5 | 4ea9a6896cde8b0984d97b5cb1513884 |
|
BLAKE2b-256 | 70f84c6d4fc2bb350e06daf99661968f8c85a9610c3d454a3dfeb2af4be5f462 |