Skip to content

Support rvalues in adaptors::indexed #128

@FelixDombek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions