Skip to content

Commit 54a210d

Browse files
committed
Add const iterator to symbol table
This adds const iterators to iterate over the internal_symbols map of the symbol table. So far, only non-const iterators existed.
1 parent 56ca42a commit 54a210d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/util/symbol_table.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ class symbol_tablet : public symbol_table_baset
117117
return iteratort(internal_symbols.end());
118118
}
119119

120+
typedef symbolst::const_iterator const_iteratort;
121+
122+
virtual const_iteratort begin() const
123+
{
124+
return internal_symbols.begin();
125+
}
126+
127+
virtual const_iteratort end() const
128+
{
129+
return internal_symbols.end();
130+
}
131+
120132
/// Check that the symbol table is well-formed
121133
void validate(const validation_modet vm = validation_modet::INVARIANT) const;
122134

0 commit comments

Comments
 (0)