@@ -977,6 +977,10 @@ inline void sort(IteratorTy Start, IteratorTy End) {
977
977
std::sort (Start, End);
978
978
}
979
979
980
+ template <typename Container> inline void sort (Container &&C) {
981
+ llvm::sort (adl_begin (C), adl_end (C));
982
+ }
983
+
980
984
template <typename IteratorTy, typename Compare>
981
985
inline void sort (IteratorTy Start, IteratorTy End, Compare Comp) {
982
986
#ifdef EXPENSIVE_CHECKS
@@ -986,6 +990,11 @@ inline void sort(IteratorTy Start, IteratorTy End, Compare Comp) {
986
990
std::sort (Start, End, Comp);
987
991
}
988
992
993
+ template <typename Container, typename Compare>
994
+ inline void sort (Container &&C, Compare Comp) {
995
+ llvm::sort (adl_begin (C), adl_end (C), Comp);
996
+ }
997
+
989
998
// ===----------------------------------------------------------------------===//
990
999
// Extra additions to <algorithm>
991
1000
// ===----------------------------------------------------------------------===//
@@ -1137,6 +1146,11 @@ auto upper_bound(R &&Range, ForwardIt I) -> decltype(adl_begin(Range)) {
1137
1146
return std::upper_bound (adl_begin (Range), adl_end (Range), I);
1138
1147
}
1139
1148
1149
+ template <typename R, typename ForwardIt, typename Compare>
1150
+ auto upper_bound (R &&Range, ForwardIt I, Compare C)
1151
+ -> decltype(adl_begin(Range)) {
1152
+ return std::upper_bound (adl_begin (Range), adl_end (Range), I, C);
1153
+ }
1140
1154
// / Wrapper function around std::equal to detect if all elements
1141
1155
// / in a container are same.
1142
1156
template <typename R>
0 commit comments