简体   繁体   中英

Is std::array iterator typedef implementation defined

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?

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
    ...
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM