From 6610577a3e38814e86abc04818643712f0db544a Mon Sep 17 00:00:00 2001 From: Mateusz Loskot Date: Thu, 2 Jul 2015 14:14:51 +0200 Subject: [PATCH] Update FAQ 8 with shorter version of clean-and-minimize idiom. Credits to @pah who suggested it in comment to #368. --- doc/faq.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/faq.md b/doc/faq.md index 093e8e7b..2e8de47c 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -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)