I assume you mean “is an iterator valid,” that it hasn’t been invalidated due to changes to the container (e.g., inserting/erasing to/from a vector). In that case, no, you cannot determine if an iterator is (safely) dereferencable.
More Related Contents:
- Why use iterators instead of array indices?
- Why are Standard iterator ranges [begin, end) instead of [begin, end]?
- What happens if you call erase() on a map element while iterating from begin to end?
- Removing item from vector while iterating?
- comparing iterators from different containers
- Why use non-member begin and end functions in C++11?
- Sorting a vector in descending order
- How are iterators and pointers related?
- What’s faster, iterating an STL vector with vector::iterator or with at()?
- What is the difference between const_iterator and non-const iterator in the C++ STL?
- What is an iterator’s default value?
- Custom Iterator in C++
- Why is “!=” used with iterators instead of “
- how portable is end iterator decrement?
- Can std::begin work with array parameters and if so, how?
- std::vector iterator invalidation
- How does std::copy work with stream iterators
- Why does a push_back on an std::list change a reverse iterator initialized with rbegin?
- Can raw pointers be used instead of iterators with STL algorithms for containers with linear storage?
- How to remove constness of const_iterator?
- What happens if you increment an iterator that is equal to the end iterator of an STL container
- Are const_iterators faster?
- How to check that the passed Iterator is a random access iterator?
- Do STL iterators guarantee validity after collection was changed?
- Incrementing iterators: Is ++it more efficient than it++? [duplicate]
- what is the difference between const_iterator and iterator? [duplicate]
- How to increment an iterator by 2?
- Types of iterator : Output vs. Input vs. Forward vs. Random Access Iterator
- iterator for 2d vector
- How can I copy one map into another using std::copy?