Skip to content

Commit b8a1ecd

Browse files
committed
[stlextras] Add overloads for binary_search that take containers.
1 parent 25949c2 commit b8a1ecd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Basic/STLExtras.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,12 @@ inline T accumulate(const Container &C, T init, BinaryOperation op) {
639639
}
640640

641641
template <typename Container, typename T>
642-
inline bool binary_search(const Container &C, T value) {
642+
inline bool binary_search(const Container &C, const T &value) {
643643
return std::binary_search(C.begin(), C.end(), value);
644644
}
645645

646646
template <typename Container, typename T, typename BinaryOperation>
647-
inline bool binary_search(const Container &C, T value, BinaryOperation op) {
647+
inline bool binary_search(const Container &C, const T &value, BinaryOperation op) {
648648
return std::binary_search(C.begin(), C.end(), value, op);
649649
}
650650

0 commit comments

Comments
 (0)