@@ -137,7 +137,7 @@ class Trie {
137
137
// / Find all keys that begin with the given symbol. Fn must take a single
138
138
// / argument of type ValueType.
139
139
template <typename Fn>
140
- void findAll (Symbol symbol, Fn fn) {
140
+ void findAll (Symbol symbol, Fn fn) const {
141
141
auto found = Root.Entries .find (symbol);
142
142
if (found == Root.Entries .end ())
143
143
return ;
@@ -157,7 +157,7 @@ class Trie {
157
157
// / [begin,end) matches a prefix of the key. Fn must take a single
158
158
// / argument of type ValueType.
159
159
template <typename Iter, typename Fn>
160
- void findAll (Iter begin, Iter end, Fn fn) {
160
+ void findAll (Iter begin, Iter end, Fn fn) const {
161
161
assert (begin != end);
162
162
auto *node = &Root;
163
163
@@ -189,7 +189,7 @@ class Trie {
189
189
// / Depth-first traversal of all children of the given node, including
190
190
// / the node itself. Fn must take a single argument of type ValueType.
191
191
template <typename Fn>
192
- void visitChildren (Node *node, Fn fn) {
192
+ void visitChildren (const Node *node, Fn fn) const {
193
193
for (const auto &pair : node->Entries ) {
194
194
const auto &entry = pair.second ;
195
195
if (entry.Value )
0 commit comments