diff options
author | Zahary Karadjov <zahary@gmail.com> | 2015-04-13 23:49:41 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2015-04-13 23:49:41 +0300 |
commit | 1ebf1aaa80664bfb19ca09845d4258fe6dff25df (patch) | |
tree | 397c33c3c0c9c9b110d3bcd93819212c0075aa09 /doc/nimc.txt | |
parent | 6c78f1a43d256c7d5e936d87946ae0edf35ddecb (diff) | |
download | Nim-1ebf1aaa80664bfb19ca09845d4258fe6dff25df.tar.gz |
importing of C++ nested generics like std::vector<T>::iterator, using the apostrophe operator
Diffstat (limited to 'doc/nimc.txt')
-rw-r--r-- | doc/nimc.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/nimc.txt b/doc/nimc.txt index 831fce567..1af35d694 100644 --- a/doc/nimc.txt +++ b/doc/nimc.txt @@ -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 |