boostorg / move

Boost.org move module
http://boost.org/libs/move
Boost Software License 1.0
20 stars 52 forks source link

movelib appears to ignore std::iterator_traits #21

Closed mikezackles closed 3 years ago

mikezackles commented 5 years ago

I was attempting to use range-v3 with boost::container::small_vector, but by default there is an issue with converting range-v3 iterators for use with small_vector::insert. range-v3 internally specializes std::iterator_traits, but movelib seems to ignore this specialization.

I can fix the issue with something like

namespace boost::movelib {
  template<typename I, typename S>
  struct iterator_traits< ::ranges::common_iterator<I, S>>
    : std::iterator_traits< ::ranges::common_iterator<I, S>>
  {};
}

but I wanted to make sure this is intended behavior.

Thanks!

igaztanaga commented 5 years ago

Yes, it is intended behavior not to rely on std::iterator_traits, specially for compilation times. I don't know which protocol ranges-v3 follows for its iterators, but it would be a nice addition.

igaztanaga commented 3 years ago

It seems ranges-v3 compatibility it's not a very requested feature since 2018 so I'm closing this issue. Thanks for the issue.