summaryrefslogtreecommitdiff
path: root/src/common/binary_find.h
diff options
context:
space:
mode:
authorGravatar Lioncash2019-10-15 14:47:42 -0400
committerGravatar Lioncash2019-10-15 15:24:50 -0400
commitac4dbd3b25f022b3ef025f6d3451712187308efb (patch)
tree0d2b2fac72afd6c8ae91935ff5c1968590bd2d8a /src/common/binary_find.h
parentMerge pull request #2965 from FernandoS27/fair-core-timing (diff)
downloadyuzu-ac4dbd3b25f022b3ef025f6d3451712187308efb.tar.gz
yuzu-ac4dbd3b25f022b3ef025f6d3451712187308efb.tar.xz
yuzu-ac4dbd3b25f022b3ef025f6d3451712187308efb.zip
common: Rename binary_find.h to algorithm.h
Makes the header more general for other potential algorithms in the future. While we're at it, include a missing <functional> include to satisfy the use of std::less.
Diffstat (limited to 'src/common/binary_find.h')
-rw-r--r--src/common/binary_find.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/common/binary_find.h b/src/common/binary_find.h
deleted file mode 100644
index 5cc523bf9..000000000
--- a/src/common/binary_find.h
+++ /dev/null
@@ -1,21 +0,0 @@
1// Copyright 2019 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <algorithm>
8
9namespace Common {
10
11template <class ForwardIt, class T, class Compare = std::less<>>
12ForwardIt BinaryFind(ForwardIt first, ForwardIt last, const T& value, Compare comp = {}) {
13 // Note: BOTH type T and the type after ForwardIt is dereferenced
14 // must be implicitly convertible to BOTH Type1 and Type2, used in Compare.
15 // This is stricter than lower_bound requirement (see above)
16
17 first = std::lower_bound(first, last, value, comp);
18 return first != last && !comp(value, *first) ? first : last;
19}
20
21} // namespace Common