aboutsummaryrefslogtreecommitdiff
path: root/frontend/util.hpp
blob: c737b2a5e0c2688dd36992b09187875e8fc35569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include <algorithm>

#include "util.h"
#include "strings.h"

template <typename T, class Predicate>
ListIterator<T> find_if_range(ListRange<T> range, Predicate pred) {
	return std::find_if(range.begin(), range.end(), pred);
}

template <typename T>
bool by_name_case_insensitive::operator () (T * object) {
	return str_lower(object->get_name().c_str()) == str_lower(this->target_name);
}