@@ -26,9 +26,11 @@ class OrderedMap
26
26
27
27
bool IsEmpty () const ;
28
28
bool Contains (const Key& key) const ;
29
- const Value& GetValue (const Key& key) const ;
30
29
size_t Count () const ;
31
30
31
+ Value& GetValue (const Key& key);
32
+ const Value& GetValue (const Key& key) const ;
33
+
32
34
bool Insert (const Key& key, const Value& value);
33
35
bool InsertBefore (const Key& key, const Value& value, const Key& nextKey);
34
36
bool InsertAfter (const Key& key, const Value& value, const Key& prevKey);
@@ -117,17 +119,25 @@ bool OrderedMap<Key, Value>::Contains (const Key& key) const
117
119
}
118
120
119
121
template <typename Key, typename Value>
120
- const Value& OrderedMap<Key, Value>::GetValue ( const Key& key ) const
122
+ size_t OrderedMap<Key, Value>::Count ( ) const
121
123
{
122
- const Iterator& iterator = keyToValueMap.at (key);
123
- const KeyValue& keyValue = *iterator;
124
+ return keyToValueMap.size ();
125
+ }
126
+
127
+ template <typename Key, typename Value>
128
+ Value& OrderedMap<Key, Value>::GetValue (const Key& key)
129
+ {
130
+ Iterator& iterator = keyToValueMap.at (key);
131
+ KeyValue& keyValue = *iterator;
124
132
return keyValue.second ;
125
133
}
126
134
127
135
template <typename Key, typename Value>
128
- size_t OrderedMap<Key, Value>::Count ( ) const
136
+ const Value& OrderedMap<Key, Value>::GetValue ( const Key& key ) const
129
137
{
130
- return keyToValueMap.size ();
138
+ const Iterator& iterator = keyToValueMap.at (key);
139
+ const KeyValue& keyValue = *iterator;
140
+ return keyValue.second ;
131
141
}
132
142
133
143
template <typename Key, typename Value>
0 commit comments