2
Copyright (C) 2000-2007 MySQL AB
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; version 2 of the License.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; see the file COPYING. If not, write to the
15
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20
/* mySTL algorithm implements max, min, for_each, swap, find_if, copy,
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