Hi Stephan;I see what the document I was reading was getting at now; good example thanks!
cheers. On 14/05/14 11:37 pm, Stephan Aßmus wrote:
Hi, Am 14.05.2014 11:48, schrieb Andrew Lindesay:My C++/STL knowledge is probably not deep enough to comment on the C++11 requirement. I just had a quick read about the "move semantics", but as you say, it is not hugely intuitive.Well, it absolutely makes sense when the compiler has an implementation for move semantics when it knows that the object being stripped of its data is a temporary object. Something like Value a = Value(parameters); a.SetValue(Value(otherParameters)); It is not so intuitive when these simple lines of code... Value a(parameters); Value b(otherParameters); a = b; ... destroy the contents of b. And from reading rapidjson docs, that seems to be what is implemented for optimization reasons. I might have gotten things wrong, though. Best regards, -Stephan
-- Andrew Lindesay