3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

Changed more code to dict<> and pool<>

This commit is contained in:
Clifford Wolf 2014-12-28 19:24:24 +01:00
parent f3a97b75c7
commit 137f35373f
5 changed files with 17 additions and 17 deletions

View file

@ -31,17 +31,17 @@ YOSYS_NAMESPACE_BEGIN
// A map-like container, but you can save and restore the state
// ------------------------------------------------
template<typename Key, typename T, typename Compare = std::less<Key>>
template<typename Key, typename T, typename OPS = hash_ops<Key>>
struct stackmap
{
private:
std::vector<std::map<Key, T*, Compare>> backup_state;
std::map<Key, T, Compare> current_state;
std::vector<dict<Key, T*, OPS>> backup_state;
dict<Key, T, OPS> current_state;
static T empty_tuple;
public:
stackmap() { }
stackmap(const std::map<Key, T, Compare> &other) : current_state(other) { }
stackmap(const dict<Key, T, OPS> &other) : current_state(other) { }
template<typename Other>
void operator=(const Other &other)
@ -94,7 +94,7 @@ public:
current_state.erase(k);
}
const std::map<Key, T, Compare> &stdmap()
const dict<Key, T, OPS> &stdmap()
{
return current_state;
}