You need to write an iterator class for std::set . How to write a constructor, so that in the end he kept a pointer to an element of the set? For example, for a vector, you can pass &v[0] and save, and how?
|
You need to write an iterator class for std::set . How to write a constructor, so that in the end he kept a pointer to an element of the set? For example, for a vector, you can pass &v[0] and save, and how?
Source: https://ru.stackoverflow.com/questions/573292/
All Articles
std::set::iterator? - yrHeTaTeJlbstd::setuses bidirectional iterators. For them, you need to define the operators++and--. To move from one element to another you need to know the internal structure of the container. You don't have access to it - yrHeTaTeJlbstd::where to put thisset. - αλεχολυτ