I want to quickly retrieve the middle value by promoting a multipurpose container with a sorted index, but the index Iterators are not random access (I do not understand why they can not be, though it is compatible with std :: set ...).
Is it an Ierator container in a fast / consistent way. Size () / 2 times?
I ran into the same problem in a different context, it seems that STL and Boost ran into one The ordered container is not provided which has random access to the order (for example to compare).
My (not so beautiful) solution was to use a class input and did "filter" in a set. After the input operation was over, it copied the vector to all the air force in the set and it was used for random access.
This solution works only in a very limited context: once you input on the container, if you change the add to the container, then all the iterators will have to be copied again. It really was very useless to use but worked.
Comments
Post a Comment