Inserts `value` into the ordered set. Returns true if the value was not present in the set before the insertion.
| 35 | // Inserts `value` into the ordered set. Returns true if the value was not |
| 36 | // present in the set before the insertion. |
| 37 | bool Insert(T value) { |
| 38 | bool new_insertion = |
| 39 | value_to_index_.insert({value, value_sequence_.size()}).second; |
| 40 | if (new_insertion) { |
| 41 | value_sequence_.push_back(value); |
| 42 | } |
| 43 | return new_insertion; |
| 44 | } |
| 45 | |
| 46 | // Removes `value` from the set. Assumes `value` is already present in the |
| 47 | // set. |