importing of C++ nested generics like std::vector<T>::iterator, using the apostrophe operator

This commit is contained in:
Zahary Karadjov
2015-04-13 23:49:41 +03:00
parent 6c78f1a43d
commit 1ebf1aaa80
6 changed files with 101 additions and 16 deletions

View File

@@ -596,6 +596,25 @@ Produces:
x[6] = 91.4;
- If more precise control is needed, the apostrophe ``'`` can be used in the
supplied pattern to denote the concrete type parameters of the generic type.
See the usage of the apostrophe operator in proc patterns for more details.
.. code-block:: nim
type
VectorIterator {.importcpp: "std::vector<'0>::iterator".} [T] = object
var x: VectorIterator[cint]
Produces:
.. code-block:: C
std::vector<int>::iterator x;
ImportObjC pragma
-----------------
Similar to the `importc pragma for C <manual.html#importc-pragma>`_, the