For example, consider some hypothetical ones to_upper_iteratorthat are repeated in a range of characters, returning std::toupperfor operator*. These iterator aliases make sense to me:
template <typename CharT>
struct to_upper_iterator
{
using value_type = CharT;
using reference = CharT;
using difference_type = std::ptrdiff_t;
using iterator_category = std::random_access_iterator_tag;
};
What does not make sense is what should / could be used for an alias pointer. I tried to leave it, but of course I had compilation errors. This seems to be due to the addition in C ++ 17. Generalized to en.cppreference.com for type std::iterator_traits:
If Iteratorno type-five members difference_type, value_type, pointer, referenceand iterator_category, it is not that the template members of any of these names ( std::iterator_traitsis SFINAE-friendly)
, : , pointer - - void void* - - specialize std::iterator_traits<to_upper_iterator>, pointer.