mardi 27 juin 2017

compare nested iterators after boost transformed()

vector<vector<int>> input{ { { 1, 2 },{ 3, 4 } } };
auto result = input | boost::adaptors::transformed([](const auto& _) {return _; });
result.begin()->begin() == result.begin()->end();

If I run this w/ VS2015 with _ITERATOR_DEBUG_LEVEL=2, then it fires this error in _Compat(const _Myiter& _Right):

        _DEBUG_ERROR("vector iterators incompatible");

This is important because Flattening iterator uses this comparison in advance_past_empty_inner_containers().

What's going on? How do I fix it?

Aucun commentaire:

Enregistrer un commentaire