From 98f87905d96c2853a84c717b3de1e65571c7e4e2 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Fri, 26 Sep 2014 11:32:25 +0800 Subject: [PATCH] Update tutorial.md Correct `PushBack()` example --- doc/tutorial.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index d22b6a3..857895d 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -334,9 +334,10 @@ Sometimes, it is convenient to construct a Value in place, before passing it to ~~~~~~~~~~cpp Value a(kArrayType); -// a.PushBack(Value(42)); // will not compile -a.PushBack(Value().SetInt(42)); // fluent API -a.PushBack(Value(42).Move()); // same as above +Document::AllocatorType& allocator = document.GetAllocator(); +// a.PushBack(Value(42), allocator); // will not compile +a.PushBack(Value().SetInt(42), allocator); // fluent API +a.PushBack(Value(42).Move(), allocator); // same as above ~~~~~~~~~~ ## Create String {#CreateString}