From 2c073486961c24a49bd9dcb57407a2e024ea6a13 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 22 Feb 2005 23:19:42 +0000 Subject: [PATCH] Remove a bunch of dead templates. llvm-svn: 20275 --- llvm/include/llvm/ADT/STLExtras.h | 73 ------------------------------- 1 file changed, 73 deletions(-) diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 14b61bc916c3..e13f9f9ce7ab 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -187,79 +187,6 @@ inline ItTy prior(ItTy it) return it; } - -//===----------------------------------------------------------------------===// -// Extra additions to -//===----------------------------------------------------------------------===// - -// 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 -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 -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 -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 -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 -inline bool reduce_apply_bool(InputIt First, InputIt Last, Function Func) { - return reduce_apply(First, Last, bitwise_or(), false, Func); -} - - -// map - This function maps the specified input sequence into the specified -// output iterator, applying a unary function in between. -// -template -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 //===----------------------------------------------------------------------===//