Skip to content

Move semantics with std::initializer_list #225

Closed

Description

@ahorn

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.

Activity

  1. nlohmann commented on Mar 21, 2016

    @nlohmann
    Owner

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

  2. self-assigned this
    on Mar 30, 2016
  3. added this to the Release 2.0.0 milestone on Mar 30, 2016
  4. nlohmann commented on Mar 30, 2016

    @nlohmann
    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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions