Am I missing something, or is there no way to get an iterator beginning at the newly-inserted value in a BTreeSet
?
BTreeSet::insert
just returns a boolean. For comparison, the insert
method for std::map
in C++ returns a pair of an iterator and a boolean.
It is possible to look up the newly-inserted element and get the iterator that way, but that's inefficient.
This isn't a duplicate of How to lookup from and insert into a HashMap efficiently? as I need to get an iterator pointing to the location of the newly inserted value. I want to obtain the preceding and following values, if these exist.