Commit 98f87905 authored by Milo Yip's avatar Milo Yip

Update tutorial.md

Correct `PushBack()` example
parent a2354cd7
...@@ -334,9 +334,10 @@ Sometimes, it is convenient to construct a Value in place, before passing it to ...@@ -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}
......
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