Skip to content

Support rvalues in adaptors::indexed #128

Description

@FelixDombek

Using a normal ranged for with an rvalue is supported in C++, so adaptors::indexed should support it too.

Currently it is too easy to get a segfault:

std::vector<int> getVec();
for (const auto& i : boost::adaptors::index(getVec())) { std::cout << i; }

This should have a move constructor and be able to store the temporary object.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions