#pragma once #include #include #include template class fifoMap: public std::deque> { public: bool contains(const K &) const; V &operator[](const K&); }; template bool fifoMap::contains(const K &k) const { for (std::pair i: *this) if (i.first == k) return true; return false; } template V &fifoMap::operator[](const K &k) { for (std::pair &i: *this) if (i.first == k) return i.second; this->push_back(std::pair(k, V())); std::pair &i = this->back(); return i.second; }