Json::Value should support move semantics
I see that Json::Value does not support move semantics (move constructor and move assignment operator).
Is there a reason for this? If not would you like any help on this front?
the last time we tried this there was an issue of binary compatibility. Cdunn, is that still a concern?
On Monday, March 16, 2015, georgehdd [email protected] wrote:
I see that Json::Value does not support move semantics (move constructor and move assignment operator).
Is there a reason for this? If not would you like any help on this front?
— Reply to this email directly or view it on GitHub https://github.com/open-source-parsers/jsoncpp/issues/223.
ǝnɥɐuop ʎllıq
Yes. But since we've just introduced a rather serious backward-incompatibility vs. 1.4 (the virtual dtor in the Reader Builder) we could add it immediately on the 1.. branch. The 0.. branch would exclude it and would remain compatible with 0.6.0-rc2, which is the most important thing.
The real issue is that if 1.. goes too far down the C++-11 path, then 0.. will not be patchable with bug-fixes common to both. However, I think we're past the worst of the bugs at this point, so I'd be fine with starting 2.. right away and letting it diverge. Or even with letting 1.. diverge, if that's not too confusing.
I'll be AFK for a couple weeks, so do whatever you think best.
Would you like me to create a pull request for this? If so please let me know what compilers are supported.
Sure.
Officially, we support the versions of gcc an clang used by default in Travis CI, which would be run automatically on your pull request. Unofficially, when users submit patches for others (esp. versions of VisualStudio) we accept them. In general, we support older compilers in the 0.. branch than in the 1.. branch, so just make your changes on 1.. (which is master).
I created a pull request for this but it failed to merge :( Please take a look
https://github.com/open-source-parsers/jsoncpp/pull/264
Should this remain open?
@tshepang, I guess not. Thanks for noticing.
So there is no plan on adding the move semantics to Value?
Looking at the old discussion, I think the conclusion was that we would have to remove an assignment operator, which would break binary compatibility. So it would be a 2.0 release. And in that case, we might want to add other things as well. So it's not exactly dead, but not imminent.