| 48 | } |
| 49 | } |
| 50 | T ValueAt(int position) { |
| 51 | if (states.empty()) |
| 52 | return T(); |
| 53 | if (position < states[0].position) |
| 54 | return T(); |
| 55 | typename stateVector::iterator low = Find(position); |
| 56 | if (low == states.end()) { |
| 57 | return states[states.size()-1].value; |
| 58 | } else { |
| 59 | if (low->position > position) { |
| 60 | --low; |
| 61 | } |
| 62 | return low->value; |
| 63 | } |
| 64 | } |
| 65 | bool Delete(int position) { |
| 66 | typename stateVector::iterator low = Find(position); |
| 67 | if (low != states.end()) { |