Merge pull request #1364 from jcourtat/fixfaq

faq: fix document insertion example
This commit is contained in:
Milo Yip 2018-09-19 12:58:14 +08:00 committed by GitHub
commit 2a5e733b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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:
~~~~~~~~~~cpp
Document address(person.GetAllocator());
Document address(&person.GetAllocator());
...
person["person"].AddMember("address", address["address"], person.GetAllocator());
~~~~~~~~~~

View File

@ -145,7 +145,7 @@
一个简单有效的方法就是修改上述 `address` 变量的定义,让其使用 `person` 的 allocator 初始化,然后将其添加到根节点。
~~~~~~~~~~cpp
Documnet address(person.GetAllocator());
Documnet address(&person.GetAllocator());
...
person["person"].AddMember("address", address["address"], person.GetAllocator());
~~~~~~~~~~