23 template<
class Key,
class Value>
28 typename std::vector<std::pair<Key, Value>>::iterator;
29 using const_iterator =
30 typename std::vector<std::pair<Key, Value>>::const_iterator;
32 auto size()
const {
return data.size(); }
33 bool empty()
const {
return data.empty(); }
34 auto begin() {
return data.begin(); }
35 auto begin()
const {
return data.begin(); }
36 auto end() {
return data.end(); }
37 auto end()
const {
return data.end(); }
38 auto cbegin()
const {
return data.begin(); }
39 auto cend()
const {
return data.end(); }
41 iterator erase(iterator iter) {
42 size_t pos = std::distance(begin(), iter);
44 return data.begin() + pos;
46 iterator find(Key
const &value) {
47 auto first = data.begin();
48 const auto end = data.end();
49 while (first != end) {
50 if (first->first == value)
56 const_iterator find(Key
const &value)
const {
57 auto first = data.begin();
58 const auto end = data.end();
59 while (first != end) {
60 if (first->first == value)
67 Value &operator[](Key
const &key) {
70 data.push_back({key, Value()});
71 return data.back().second;
78 std::vector<std::pair<Key, Value>> data;
Definition: linear_map.h:24
Namespace for csl library.
Definition: abreviation.h:34