| 210 | } |
| 211 | |
| 212 | bool next(const Key &key, Key *next_key, |
| 213 | bool allow_rollover = false) const { |
| 214 | const_iterator it = find(key); |
| 215 | if (it != end()) { |
| 216 | ++it; |
| 217 | if (it != end()) { |
| 218 | *next_key = it->first; |
| 219 | return true; |
| 220 | } else if (allow_rollover && !empty()) { |
| 221 | *next_key = begin()->first; |
| 222 | return true; |
| 223 | } |
| 224 | } |
| 225 | return false; |
| 226 | } |
| 227 | |
| 228 | bool prev(const Key &key, Key *prev_key, |
| 229 | bool allow_rollover = false) const { |