Unverified Commit 2a5e733b authored by Milo Yip's avatar Milo Yip Committed by GitHub

Merge pull request #1364 from jcourtat/fixfaq

faq: fix document insertion example
parents c0ca05f6 68349ed9
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
Simple yet most efficient way to achieve that is to modify the `address` definition above to initialize it with allocator of the `person` document, then we just add the root member of the value: Simple yet most efficient way to achieve that is to modify the `address` definition above to initialize it with allocator of the `person` document, then we just add the root member of the value:
~~~~~~~~~~cpp ~~~~~~~~~~cpp
Document address(person.GetAllocator()); Document address(&person.GetAllocator());
... ...
person["person"].AddMember("address", address["address"], person.GetAllocator()); person["person"].AddMember("address", address["address"], person.GetAllocator());
~~~~~~~~~~ ~~~~~~~~~~
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
一个简单有效的方法就是修改上述 `address` 变量的定义,让其使用 `person` 的 allocator 初始化,然后将其添加到根节点。 一个简单有效的方法就是修改上述 `address` 变量的定义,让其使用 `person` 的 allocator 初始化,然后将其添加到根节点。
~~~~~~~~~~cpp ~~~~~~~~~~cpp
Documnet address(person.GetAllocator()); Documnet address(&person.GetAllocator());
... ...
person["person"].AddMember("address", address["address"], person.GetAllocator()); person["person"].AddMember("address", address["address"], person.GetAllocator());
~~~~~~~~~~ ~~~~~~~~~~
......
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