Commit 9e021d86 authored by Robert Bradshaw's avatar Robert Bradshaw

Add note about the address and comma operators.

parent f3a80118
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.. _wrapping-cplusplus: .. _wrapping-cplusplus:
******************************** ********************************
Using C++ in Cython Using C++ in Cythonp
******************************** ********************************
Overview Overview
...@@ -362,9 +362,13 @@ a special module ``cython.operator``. The functions provided are: ...@@ -362,9 +362,13 @@ a special module ``cython.operator``. The functions provided are:
* ``cython.operator.dereference`` for dereferencing. ``dereference(foo)`` * ``cython.operator.dereference`` for dereferencing. ``dereference(foo)``
will produce the C++ code ``*(foo)`` will produce the C++ code ``*(foo)``
* ``cython.operator.address`` for taking an address. ``address(foo)``
will produce the C++ code ``&(foo)``
* ``cython.operator.preincrement`` for pre-incrementation. ``preincrement(foo)`` * ``cython.operator.preincrement`` for pre-incrementation. ``preincrement(foo)``
will produce the C++ code ``++(foo)`` will produce the C++ code ``++(foo)``.
* ... Similarly for ``predecrement``, ``postincrement`` and ``postdecrement``.
* ``cython.operator.comma`` for the comma operator. ``comma(a, b)``
will produce the C++ code ``((a), (b))``.
These functions need to be cimported. Of course, one can use a These functions need to be cimported. Of course, one can use a
``from ... cimport ... as`` to have shorter and more readable functions. ``from ... cimport ... as`` to have shorter and more readable functions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment