json icon indicating copy to clipboard operation
json copied to clipboard

Copy/alias std::iter_value_t in implementation of detail::value_type

Open grisumbras opened this issue 2 years ago • 1 comments

The main problem with detail::value_type is that it does not use iterator_traits::value_type. This is not an issue with most iterators, but is definitely an issue with proxy iterators (e.g. std::vector<bool>::iterator). Standard Ranges library uses a multi-step approach to determine the appropriate value type of a range. We can copy (most of) it and even alias it in C++20.

grisumbras avatar Sep 29 '22 08:09 grisumbras

Where do we need to use iter_value?

vinniefalco avatar Sep 29 '22 14:09 vinniefalco

When we use detail::value_type, that is for conversions.

grisumbras avatar Oct 17 '22 14:10 grisumbras