Skip to content

std::any_of fails because of the lack of iterator-traits after doing a 'Map' #1

@jeroen-dhollander

Description

@jeroen-dhollander

Just try this:

TEST(any_of, it_fails)
{
    auto collection = iterators::Map(std::list<int>({1, 2, 3}), [](int i) { return i + 2; });

    std::any_of(collection.begin(), collection.end(), [](int i) { return i > 4; });
}

And you get this:

/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/stl_iterator_base_types.h:205:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<iterators::MappedIterator<std::_List_iterator<int>, ::any_of_it_fails_Test::TestBody()::<lambda(int)> > >'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions