2 parray.hh -- declare Pointer_array
4 source file of the Flower Library
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
19 should init to 0. Derive from Array<void*>?
22 class Link_array : public Array<T*>
24 static default_compare(T *const& p1, T *const&p2) {
25 /* can't do p1 -p2, since T might be an incomplete type */
33 void substitute(T *old, T*new_l)
36 while ((i = find_i(old)) >=0)
43 sort(default_compare);
47 for (int i=0; i < size(); i++)
48 if (!i || elem(i-1) != elem(i))
53 int find_i (T const * t) const {
54 for (int i=0; i < size(); i++)
59 T *find_l(T const *t)const