Home > Back-end >  Is std::array iterator typedef implementation defined
Is std::array iterator typedef implementation defined

Time:12-19

Is the iterator type requirement for std::array<T,N>::iterator implementation defined or is it always defined to be a pointer to value_type?

CodePudding user response:

It's implementation-defined.

See the C 20 Standard (working draft, the final version costs money), section 22.3.7, "Class template array":

namespace std {
template<class T, size_t N>
struct array {
    // types
    ...
    using iterator = implementation-defined ; // see 22.2
    using const_iterator = implementation-defined ; // see 22.2
    ...
};
  • Related