From 68349ed9141952c100143998cd89b4b1b930b817 Mon Sep 17 00:00:00 2001 From: Julien Courtat Date: Tue, 18 Sep 2018 14:51:12 +0200 Subject: [PATCH] faq: fix document insertion example GenericDocument contructor requires a pointer to an Allocator, but GetAllocator() only returns a reference. Signed-off-by: Julien Courtat --- doc/faq.md | 2 +- doc/faq.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/faq.md b/doc/faq.md index 1d738c0..9abfdf1 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -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()); ~~~~~~~~~~ diff --git a/doc/faq.zh-cn.md b/doc/faq.zh-cn.md index f279acf..bdacfce 100644 --- a/doc/faq.zh-cn.md +++ b/doc/faq.zh-cn.md @@ -145,7 +145,7 @@ 一个简单有效的方法就是修改上述 `address` 变量的定义,让其使用 `person` 的 allocator 初始化,然后将其添加到根节点。 ~~~~~~~~~~cpp - Documnet address(person.GetAllocator()); + Documnet address(&person.GetAllocator()); ... person["person"].AddMember("address", address["address"], person.GetAllocator()); ~~~~~~~~~~