Update tutorial.md

Correct `PushBack()` example
This commit is contained in:
Milo Yip 2014-09-26 11:32:25 +08:00
parent a2354cd745
commit 98f87905d9

View File

@ -334,9 +334,10 @@ Sometimes, it is convenient to construct a Value in place, before passing it to
~~~~~~~~~~cpp ~~~~~~~~~~cpp
Value a(kArrayType); Value a(kArrayType);
// a.PushBack(Value(42)); // will not compile Document::AllocatorType& allocator = document.GetAllocator();
a.PushBack(Value().SetInt(42)); // fluent API // a.PushBack(Value(42), allocator); // will not compile
a.PushBack(Value(42).Move()); // same as above a.PushBack(Value().SetInt(42), allocator); // fluent API
a.PushBack(Value(42).Move(), allocator); // same as above
~~~~~~~~~~ ~~~~~~~~~~
## Create String {#CreateString} ## Create String {#CreateString}