2 (c) Han-Wen Nienhuys 1995,96,97,98
4 Distributed under GNU GPL
18 functions with loops don't inline
21 template<class T> INLINE void
22 arrcpy (T*dest, T*src, int count)
24 for (int i_shadows_local=0; i_shadows_local < count ; i_shadows_local++)
28 template<class T> INLINE void
29 Array<T>::insert (T k, int j)
31 assert (j >=0 && j<= size_);
33 for (int i=size_-1; i > j; i--)
34 array_p_[i] = array_p_[i-1];
38 template<class T> INLINE void
39 Array<T>::sort (int (*compare)(T const&,T const&),
40 int lower = -1, int upper = -1)
49 swap (lower, (lower+upper)/2);
51 for (int i= lower +1; i <= upper; i++)
52 if (compare (array_p_[i], array_p_[lower]) < 0)
55 sort (compare, lower, last-1);
56 sort (compare, last+1, upper);
59 template<class T> INLINE void
63 for (int i =0,j = size_-1; i < h; i++,j--)
67 template<class T> INLINE
71 assert (max_ >= size_ && size_ >=0);
72 if (max_) assert (array_p_);
75 template<class T> INLINE
77 Array<T>::remove_array_p ()
86 template<class T> INLINE
88 Array<T>::slice (int lower, int upper)
90 assert (lower >= 0 && lower <=upper&& upper <= size_);
94 arrcpy (r.array_p_, array_p_ + lower, s);