9#ifndef CPROVER_UTIL_FORWARD_LIST_AS_MAP_H
10#define CPROVER_UTIL_FORWARD_LIST_AS_MAP_H
13#include <forward_list>
19template <
typename keyt,
typename mappedt>
26 using iterator =
typename implementationt::iterator;
41 if(it != this->end() && it->first == name)
44 while(std::next(before) != it)
54 if(it == this->end() || it->first != name)
64 if(it == this->end() || it->first != name)
67 while(std::next(before) != it)
77 return add(name)->second;
84 if(it == this->end() || it->first != name)
87 while(std::next(before) != it)
92 it->second = std::move(irep);
101 if(it == this->end() || it->first != name)
104 while(std::next(before) != it)
120 static bool order(
const std::pair<keyt, mappedt> &
a,
const keyt &
b)
120 static bool order(
const std::pair<keyt, mappedt> &
a,
const keyt &
b) {
…}
127 return std::lower_bound(this->begin(), this->end(),
id,
order);
132 return std::lower_bound(this->begin(), this->end(),
id,
order);
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Implementation of map-like interface using a forward list.
const const_iterator find(const keyt &name) const
iterator mutable_lower_bound(const keyt &id)
typename std::forward_list< std::pair< keyt, mappedt > > implementationt
typename implementationt::iterator iterator
forward_list_as_mapt(std::initializer_list< std::pair< keyt, mappedt > > list)
iterator add(const keyt &name)
void erase(const keyt &name)
const_iterator lower_bound(const keyt &id) const
mappedt & operator[](const keyt &name)
mappedt & add(const keyt &name, mappedt irep)
mappedt & emplace(const keyt &name, const mappedt &irep)
typename implementationt::const_iterator const_iterator
static bool order(const std::pair< keyt, mappedt > &a, const keyt &b)