#1660

common_iterator: expose iterator_traits aliases

Opentheodelrieuwants to merge intofrom

Boost.Move own iterator_traits fails to compile when using ranges::to<flat_map>, as it relies on the iterator's member types.

EDIT: example output

/Users/theo/.conan/data/boost/1.76.0/_/_/package/aab501a79b7a20cf10f7293cf64da1317989934c/include/boost/move/detail/iterator_traits.hpp:46:31: error: no type named 'value_type' in 'ranges::common_iterator<ranges::basic_iterator<ranges::adaptor_cursor<ranges::basic_iterator<ranges::group_by_view<ranges::ref_view<const std::__1::vector<boost::variant2::variant<Tanker::Trustchain::Actions::UserGroupAddition, Tanker::Trustchain::Actions::UserGroupCreation>>>, (lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:153:36)>::cursor>, ranges::iter_transform_view<ranges::group_by_view<ranges::ref_view<const std::__1::vector<boost::variant2::variant<Tanker::Trustchain::Actions::UserGroupAddition, Tanker::Trustchain::Actions::UserGroupCreation>>>, (lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:153:36)>, ranges::indirected<(lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:156:37)>>::adaptor<false>>>, ranges::adaptor_sentinel<ranges::default_sentinel_t, ranges::adaptor_base>>'
   typedef typename Iterator::value_type        value_type;
           ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/Users/theo/.conan/data/boost/1.76.0/_/_/package/aab501a79b7a20cf10f7293cf64da1317989934c/include/boost/container/vector.hpp:2003:22: note: in instantiation of template class 'boost::movelib::iterator_traits<ranges::common_iterator<ranges::basic_iterator<ranges::adaptor_cursor<ranges::basic_iterator<ranges::group_by_view<ranges::ref_view<const std::__1::vector<boost::variant2::variant<Tanker::Trustchain::Actions::UserGroupAddition, Tanker::Trustchain::Actions::UserGroupCreation>>>, (lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:153:36)>::cursor>, ranges::iter_transform_view<ranges::group_by_view<ranges::ref_view<const std::__1::vector<boost::variant2::variant<Tanker::Trustchain::Actions::UserGroupAddition, Tanker::Trustchain::Actions::UserGroupCreation>>>, (lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:153:36)>, ranges::indirected<(lambda at ../../modules/sdk-core/src/Groups/Accessor.cpp:156:37)>>::adaptor<false>>>, ranges::adaptor_sentinel<ranges::default_sentinel_t, ranges::adaptor_base>>>' requested here
      const typename iterator_traits<FwdIt>::size_type sz = boost::container::iterator_distance(first, last);

I've opened https://github.com/boostorg/move/pull/43 to fix further Boost.Move releases.

Activity

2
brevzin4y ago

Can you (a) provide a full example that fails with (b) a standalone test case that demonstrates the current failure that would pass with these changes? Ion said he couldn't reproduce it, and it's not clear to me what the issue is.