mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-06 13:41:35 +01:00
Update FAQ 8 with shorter version of clean-and-minimize idiom.
Credits to @pah who suggested it in comment to #368.
This commit is contained in:
parent
a45a289c0c
commit
6610577a3e
@ -114,7 +114,11 @@
|
||||
|
||||
* 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())
|
||||
Value(kObjectType).Swap(d);
|
||||
```
|
||||
or equivalent, but sightly longer to type:
|
||||
```
|
||||
d.Swap(Value(kObjectType).Move());
|
||||
```
|
||||
|
||||
## Document/Value (DOM)
|
||||
|
Loading…
x
Reference in New Issue
Block a user