[llvm-commits] CVS: llvm/include/llvm/ADT/STLExtras.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 22 15:19:59 PST 2005
Changes in directory llvm/include/llvm/ADT:
STLExtras.h updated: 1.18 -> 1.19
---
Log message:
Remove a bunch of dead templates.
---
Diffs of the changes: (+0 -73)
STLExtras.h | 73 ------------------------------------------------------------
1 files changed, 73 deletions(-)
Index: llvm/include/llvm/ADT/STLExtras.h
diff -u llvm/include/llvm/ADT/STLExtras.h:1.18 llvm/include/llvm/ADT/STLExtras.h:1.19
--- llvm/include/llvm/ADT/STLExtras.h:1.18 Wed Sep 1 17:55:34 2004
+++ llvm/include/llvm/ADT/STLExtras.h Tue Feb 22 17:19:42 2005
@@ -187,79 +187,6 @@
return it;
}
-
-//===----------------------------------------------------------------------===//
-// Extra additions to <algorithm>
-//===----------------------------------------------------------------------===//
-
-// apply_until - Apply a functor to a sequence continually, unless the
-// functor returns true. Return true if the functor returned true, return false
-// if the functor never returned true.
-//
-template <class InputIt, class Function>
-bool apply_until(InputIt First, InputIt Last, Function Func) {
- for ( ; First != Last; ++First)
- if (Func(*First)) return true;
- return false;
-}
-
-
-// reduce - Reduce a sequence values into a single value, given an initial
-// value and an operator.
-//
-template <class InputIt, class Function, class ValueType>
-ValueType reduce(InputIt First, InputIt Last, Function Func, ValueType Value) {
- for ( ; First != Last; ++First)
- Value = Func(*First, Value);
- return Value;
-}
-
-#if 1 // This is likely to be more efficient
-
-// reduce_apply - Reduce the result of applying a function to each value in a
-// sequence, given an initial value, an operator, a function, and a sequence.
-//
-template <class InputIt, class Function, class ValueType, class TransFunc>
-inline ValueType reduce_apply(InputIt First, InputIt Last, Function Func,
- ValueType Value, TransFunc XForm) {
- for ( ; First != Last; ++First)
- Value = Func(XForm(*First), Value);
- return Value;
-}
-
-#else // This is arguably more elegant
-
-// reduce_apply - Reduce the result of applying a function to each value in a
-// sequence, given an initial value, an operator, a function, and a sequence.
-//
-template <class InputIt, class Function, class ValueType, class TransFunc>
-inline ValueType reduce_apply2(InputIt First, InputIt Last, Function Func,
- ValueType Value, TransFunc XForm) {
- return reduce(map_iterator(First, XForm), map_iterator(Last, XForm),
- Func, Value);
-}
-#endif
-
-
-// reduce_apply_bool - Reduce the result of applying a (bool returning) function
-// to each value in a sequence. All of the bools returned by the mapped
-// function are bitwise or'd together, and the result is returned.
-//
-template <class InputIt, class Function>
-inline bool reduce_apply_bool(InputIt First, InputIt Last, Function Func) {
- return reduce_apply(First, Last, bitwise_or<bool>(), false, Func);
-}
-
-
-// map - This function maps the specified input sequence into the specified
-// output iterator, applying a unary function in between.
-//
-template <class InIt, class OutIt, class Functor>
-inline OutIt mapto(InIt Begin, InIt End, OutIt Dest, Functor F) {
- return copy(map_iterator(Begin, F), map_iterator(End, F), Dest);
-}
-
-
//===----------------------------------------------------------------------===//
// Extra additions to <utility>
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list