jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

Json::Value should support move semantics

Open georgehdd opened this issue 11 years ago • 9 comments

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?

georgehdd avatar Mar 16 '15 13:03 georgehdd

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

BillyGoto avatar Mar 16 '15 13:03 BillyGoto

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.

cdunn2001 avatar Mar 16 '15 15:03 cdunn2001

Would you like me to create a pull request for this? If so please let me know what compilers are supported.

lanzkron avatar Mar 30 '15 07:03 lanzkron

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).

cdunn2001 avatar Mar 31 '15 14:03 cdunn2001

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

lanzkron avatar Apr 26 '15 09:04 lanzkron

Should this remain open?

tshepang avatar Nov 17 '15 12:11 tshepang

@tshepang, I guess not. Thanks for noticing.

cdunn2001 avatar Dec 25 '15 16:12 cdunn2001

So there is no plan on adding the move semantics to Value?

matsbror avatar Jan 14 '16 09:01 matsbror

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.

cdunn2001 avatar Jan 18 '16 04:01 cdunn2001