llvm.org GIT mirror llvm / 047d8bd
STLExtras: Add some more algorithm wrappers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342102 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 2 years ago
1 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
976976 std::sort(Start, End);
977977 }
978978
979 template inline void sort(Container &&C) {
980 llvm::sort(adl_begin(C), adl_end(C));
981 }
982
979983 template
980984 inline void sort(IteratorTy Start, IteratorTy End, Compare Comp) {
981985 #ifdef EXPENSIVE_CHECKS
983987 std::shuffle(Start, End, Generator);
984988 #endif
985989 std::sort(Start, End, Comp);
990 }
991
992 template
993 inline void sort(Container &&C, Compare Comp) {
994 llvm::sort(adl_begin(C), adl_end(C), Comp);
986995 }
987996
988997 //===----------------------------------------------------------------------===//
11361145 return std::upper_bound(adl_begin(Range), adl_end(Range), I);
11371146 }
11381147
1148 template
1149 auto upper_bound(R &&Range, ForwardIt I, Compare C)
1150 -> decltype(adl_begin(Range)) {
1151 return std::upper_bound(adl_begin(Range), adl_end(Range), I, C);
1152 }
11391153 /// Wrapper function around std::equal to detect if all elements
11401154 /// in a container are same.
11411155 template