Skip to content

Map wrappers: forward more of the std::map interface #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/pointer-analysis/value_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class value_sett
typedef data_typet::const_iterator const_iterator;
// NOLINTNEXTLINE(readability/identifiers)
typedef data_typet::value_type value_type;
// NOLINTNEXTLINE(readability/identifiers)
typedef data_typet::key_type key_type;

iterator begin() { return data.begin(); }
const_iterator begin() const { return data.begin(); }
Expand All @@ -82,7 +84,12 @@ class value_sett
size_t size() const { return data.size(); }
bool empty() const { return data.empty(); }

objectt &operator[](unsigned i) { return data[i]; }
void erase(key_type i) { data.erase(i); }
void erase(const_iterator it) { data.erase(it); }

objectt &operator[](key_type i) { return data[i]; }
objectt &at(key_type i) { return data.at(i); }
const objectt &at(key_type i) const { return data.at(i); }

template <typename It>
void insert(It b, It e) { data.insert(b, e); }
Expand Down
3 changes: 3 additions & 0 deletions src/util/numbering.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ class hash_numbering final
T &operator[](size_type t) { return data[t]; }
const T &operator[](size_type t) const { return data[t]; }

T &at(size_type t) { return data.at(t); }
const T &at(size_type t) const { return data.at(t); }

size_type size() const { return data.size(); }

iterator begin() { return data.begin(); }
Expand Down