Commit a45a289c authored by Milo Yip's avatar Milo Yip

Merge pull request #372 from mloskot/faq-issue-368

Add to FAQ: How to clear-and-minimize a document?
parents 5d5d90c1 3c47ae9f
......@@ -102,6 +102,21 @@
Some applications use 64-bit unsigned/signed integers. And these integers cannot be converted into `double` without loss of precision. So the parsers detects whether a JSON number is convertible to different types of integers and/or `double`.
8. How to clear-and-minimize a document or value?
* Call one of the `SetXXX()` methods - they call destructor which deallocates DOM data:
```
Document d;
...
d.SetObject(); // clear and minimize
```
* Alternatively, use equivalent of the [C++ swap with temporary idiom](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Clear-and-minimize):
```
d.Swap(Value(kObjectType).Move())
```
## Document/Value (DOM)
1. What is move semantics? Why?
......
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