feat(util/rb_map): add unsigned_map

This commit is contained in:
Leonardo de Moura 2016-10-03 16:26:58 -07:00
parent 7465529445
commit e6fbbbbc2d
3 changed files with 6 additions and 4 deletions

View file

@ -73,7 +73,7 @@ name mk_local_decl_name();
class metavar_context;
class local_context {
typedef rb_map<unsigned, local_decl, unsigned_cmp> idx2local_decl;
typedef unsigned_map<local_decl> idx2local_decl;
unsigned m_next_idx;
name_map<local_decl> m_name2local_decl;
subscripted_name_set m_user_names;

View file

@ -20,9 +20,9 @@ struct key_equivalence_ext : public environment_extension {
unsigned m_rank;
};
unsigned m_next_idx;
rb_map<unsigned, node, unsigned_cmp> m_nodes;
name_map<node_ref> m_to_node;
unsigned m_next_idx;
unsigned_map<node> m_nodes;
name_map<node_ref> m_to_node;
node_ref mk_node() {
node_ref r = m_next_idx;

View file

@ -127,4 +127,6 @@ template<typename K, typename T, typename CMP, typename F>
void for_each(rb_map<K, T, CMP> const & m, F && f) {
return m.for_each(f);
}
template<typename T> using unsigned_map = rb_map<unsigned, T, unsigned_cmp>;
}