Skip to content

Commit dca07dd

Browse files
author
Thomas Kiley
committed
Make the symbol_table_baset define the const iterators
Since the const iterators can use the base class directly, these are not pure virtual - so derived classes can still provide an entirely different mechanism for iterating over the symbols - though this is not currently used.
1 parent aa4eb85 commit dca07dd

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/util/symbol_table.h

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

123-
typedef symbolst::const_iterator const_iteratort;
124-
125-
virtual const_iteratort begin() const
126-
{
127-
return internal_symbols.begin();
128-
}
129-
130-
virtual const_iteratort end() const
131-
{
132-
return internal_symbols.end();
133-
}
134-
135123
/// Check that the symbol table is well-formed
136124
void validate(const validation_modet vm = validation_modet::INVARIANT) const;
137125

src/util/symbol_table_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ class symbol_table_baset
237237

238238
using const_iteratort = symbolst::const_iterator;
239239

240-
const_iteratort begin() const;
241-
const_iteratort end() const;
240+
virtual const_iteratort begin() const;
241+
virtual const_iteratort end() const;
242242
};
243243

244244
std::ostream &

0 commit comments

Comments
 (0)