24 #ifndef mySTL_ALGORITHM_HPP
25 #define mySTL_ALGORITHM_HPP
32 inline const T& max(
const T& a,
const T&b)
39 inline const T& min(
const T& a,
const T&b)
45 template<
typename InIter,
typename Func>
46 Func for_each(InIter first, InIter last, Func op)
48 while (first != last) {
57 inline void swap(T& a, T& b)
65 template<
typename InIter,
typename Pred>
66 InIter find_if(InIter first, InIter last, Pred pred)
68 while (first != last && !pred(*first))
74 template<
typename InputIter,
typename OutputIter>
75 inline OutputIter copy(InputIter first, InputIter last, OutputIter place)
77 while (first != last) {
86 template<
typename InputIter,
typename OutputIter>
88 copy_backward(InputIter first, InputIter last, OutputIter place)
96 template<
typename InputIter,
typename T>
97 void fill(InputIter first, InputIter last,
const T& v)
99 while (first != last) {
108 #endif // mySTL_ALGORITHM_HPP