summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorda-woods <dw-git@d-woods.co.uk>2021-04-05 19:27:06 +0100
committerGitHub <noreply@github.com>2021-04-05 20:27:06 +0200
commit217a93e7b139ab49815ea9ca34142b3e2a116a08 (patch)
treee9a658436dd76d30ffbb306dbb773ae9f993ae75
parent18970d354eeba8d2da1b924cb669e8919fb703af (diff)
downloadcython-217a93e7b139ab49815ea9ca34142b3e2a116a08.tar.gz
Document some additional C++ auto-conversions (GH-4090)
-rw-r--r--docs/src/userguide/wrapping_CPlusPlus.rst34
1 files changed, 21 insertions, 13 deletions
diff --git a/docs/src/userguide/wrapping_CPlusPlus.rst b/docs/src/userguide/wrapping_CPlusPlus.rst
index eed01687f..1d8a25835 100644
--- a/docs/src/userguide/wrapping_CPlusPlus.rst
+++ b/docs/src/userguide/wrapping_CPlusPlus.rst
@@ -331,19 +331,27 @@ arguments) or by an explicit cast, e.g.:
The following coercions are available:
-+------------------+----------------+-----------------+
-| Python type => | *C++ type* | => Python type |
-+==================+================+=================+
-| bytes | std::string | bytes |
-+------------------+----------------+-----------------+
-| iterable | std::vector | list |
-+------------------+----------------+-----------------+
-| iterable | std::list | list |
-+------------------+----------------+-----------------+
-| iterable | std::set | set |
-+------------------+----------------+-----------------+
-| iterable (len 2) | std::pair | tuple (len 2) |
-+------------------+----------------+-----------------+
++------------------+------------------------+-----------------+
+| Python type => | *C++ type* | => Python type |
++==================+========================+=================+
+| bytes | std::string | bytes |
++------------------+------------------------+-----------------+
+| iterable | std::vector | list |
++------------------+------------------------+-----------------+
+| iterable | std::list | list |
++------------------+------------------------+-----------------+
+| iterable | std::set | set |
++------------------+------------------------+-----------------+
+| iterable | std::unordered_set | set |
++------------------+------------------------+-----------------+
+| mapping | std::map | dict |
++------------------+------------------------+-----------------+
+| mapping | std::unordered_map | dict |
++------------------+------------------------+-----------------+
+| iterable (len 2) | std::pair | tuple (len 2) |
++------------------+------------------------+-----------------+
+| complex | std::complex | complex |
++------------------+------------------------+-----------------+
All conversions create a new container and copy the data into it.
The items in the containers are converted to a corresponding type