Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Initial C++11 move support#128

Merged
miloyip merged 12 commits into
Tencent:masterfrom
pah:feature/cxx11-move
Sep 3, 2014
Merged

Initial C++11 move support#128
miloyip merged 12 commits into
Tencent:masterfrom
pah:feature/cxx11-move

Conversation

@pah
Copy link
Copy Markdown
Contributor

@pah pah commented Aug 31, 2014

As discussed in 8005b55 and #123, C++11 move support based on rvalue-references would be useful.

This pull-request provides an initial implementation, although restricted to GenericValue only. I had a quick look and adding move support to the other classes might not be worth the effort for now.

I looked up minimum versions and detection mechanisms for Clang, GCC and MSVC. Users can set RAPIDJSON_HAS_CXX_* to override the automatic detection of the required features.

On a side path, I switched RAPIDJSON_HAS_STDSTRING to a symbol that is always available (and either 0 or 1), defaulting to 0.

There's just the remaining question, whether we want to switch on C++11 mode on travis-ci.org, maybe just for some configurations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this is not noexcept, since it will/can involve a memory allocation...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it won't allocate memory. See SetStringRaw (and comment before the constructor).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mixed that with the version taking the allocator (since I only used that for now)...

pah added 2 commits August 31, 2014 22:00
 * Move()
 * RawAssign()
 * SetStringRaw()
 * constructor from array is RAPIDJSON_NOEXCEPT
 * constructor from plain pointer missed an assert
miloyip added a commit that referenced this pull request Sep 3, 2014
@miloyip miloyip merged commit bc9d786 into Tencent:master Sep 3, 2014
@pah pah deleted the feature/cxx11-move branch September 3, 2014 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants