Refactoring; Use std::function instead of template type

This commit is contained in:
Daniel Marjamäki 2020-02-15 09:20:49 +01:00
parent 365da62624
commit df21da35bf
1 changed files with 2 additions and 2 deletions

View File

@ -122,8 +122,8 @@ struct ForwardTraversal {
return traverseRecursive(tok, f, false); return traverseRecursive(tok, f, false);
} }
template <class T, class Predicate> template <class T>
T* findRange(T* start, const Token* end, Predicate pred) { T* findRange(T* start, const Token* end, std::function<bool(ForwardAnalyzer::Action)> pred) {
for (T* tok = start; tok && tok != end; tok = tok->next()) { for (T* tok = start; tok && tok != end; tok = tok->next()) {
ForwardAnalyzer::Action action = analyzer->analyze(tok); ForwardAnalyzer::Action action = analyzer->analyze(tok);
if (pred(action)) if (pred(action))