--- trunk/src/utils/Algorithm.hpp 2005/02/13 19:14:43 325 +++ trunk/src/utils/Algorithm.hpp 2006/05/17 21:51:42 963 @@ -40,31 +40,31 @@ */ #include - +#include "config.h" namespace oopse { -/** - * copy_if is one of the missing functions in STL. - * copy_if copies elements from the range [first, last) to the range [result, result + (last-first)), - * except that any element for which pred is false is not copied. - */ -template -OutputIterator copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate p) { + /** + * copy_if is one of the missing functions in STL. + * copy_if copies elements from the range [first, last) to the range [result, result + (last-first)), + * except that any element for which pred is false is not copied. + */ + template + OutputIterator copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate p) { while (first != last) { - if (p(*first)) { - *result++ = *first; - } - ++first; + if (p(*first)) { + *result++ = *first; + } + ++first; } return result; -} + } -template -struct logical_xor :public std::binary_function { - double operator()(T x, T y) { return x ^ y; } -}; + template + struct logical_xor :public std::binary_function { + RealType operator()(T x, T y) { return x ^ y; } + }; }