find
template<class Iterator, class T>Iterator find(Iterator begin, Iterator end, const T& val){while(begin != end && *begin != val){++begin;}return begin;}
accumlate
必须要提供一个初始值的原因在于,一定得提供一个初始值init,这样当[first, last)为空区间时仍能获得一个明确的值。
template <class InputIterator, class T>T accumlate(InputIterator first, InputIterator last, T init){for(; first != last; ++first)init = init + *first;return init;}
template <class InputIterator, class T, class BinaryOperation>T accumlate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op){for(; first != last; ++first)init = binary_op(init, *first);return init;}
