Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move semantics with std::initializer_list #225

Closed
ahorn opened this issue Mar 20, 2016 · 2 comments
Closed

Move semantics with std::initializer_list #225

ahorn opened this issue Mar 20, 2016 · 2 comments

Comments

@ahorn
Copy link

ahorn commented Mar 20, 2016

Line 1564 uses move semantics when working with std::initializer_list. But when I debug the type of, say, element[1], using clang++ 3.5 and compiling the unit tests, the compiler deduces a const reference type (see also std::initializer_list::begin). There are no meaningful semantics for moving const references so I wanted to double check with you guys.

@nlohmann
Copy link
Owner

@ahorn you are right - http://stackoverflow.com/a/8193157/266378 seems to mention the same issue.

@nlohmann nlohmann self-assigned this Mar 30, 2016
@nlohmann nlohmann added this to the Release 2.0.0 milestone Mar 30, 2016
@nlohmann
Copy link
Owner

Thanks for noting! I removed the std::move calls to remove the appearance that move semantics is applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants