summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-29 06:44:48 -0600
committerGitHub <noreply@github.com>2020-12-29 13:44:48 +0100
commit732419ae907208b0b484911b996893097402a6c7 (patch)
treea69f23d7b67bade070941f3fa74a7068cf1d9153 /doc
parentd5a3c2c2da2e3b2f6deeb2c1cd5430db90bc4fd5 (diff)
downloadNim-732419ae907208b0b484911b996893097402a6c7.tar.gz
improve examples in manual (#16497)
* improve examples in manual

* Update doc/manual.rst

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update tests/cpp/ttemplatetype.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/manual.rst b/doc/manual.rst
index fd0ac0529..9fabee1e8 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -7062,8 +7062,10 @@ one can import C++'s templates rather easily without the need for a pattern
 language for object types:
 
 .. code-block:: nim
+  :test: "nim cpp $1"
+
   type
-    StdMap {.importcpp: "std::map", header: "<map>".} [K, V] = object
+    StdMap[K, V] {.importcpp: "std::map", header: "<map>".} = object
   proc `[]=`[K, V](this: var StdMap[K, V]; key: K; val: V) {.
     importcpp: "#[#] = #", header: "<map>".}