4 template < class TC
> class bilist
8 bilist
<TC
> *next
,*prev
;
10 bilist
<TC
>() { next
=prev
=0;usable
=false;};
11 bilist
<TC
>(TC
& obj
) { next
=prev
=0;object
=obj
;usable
=true;};
13 bool add(bilist
<TC
> *plist
);
14 bilist
<TC
>* del(TC
& obj
);
24 bool is_last() {return next
==0;};
25 bool is_first() {return prev
==0;};
27 bilist
<TC
> *get_next() { return next
;};
28 bilist
<TC
> *get_prev() { return prev
;};
30 void set_prev(bilist
<TC
> *plist
) { prev
=plist
;};
31 void set_next(bilist
<TC
> *plist
) { next
=plist
;};
33 TC
& get_object() { return object
;};
36 //here we are using while for searching end of list
37 template <class TC
> bool bilist
<TC
>::add(bilist
<TC
> *plist
)
40 while(ptr
->get_next()!=0)
47 //and here lets make recursion for diff :)
48 template <class TC
> bilist
<TC
>* bilist
<TC
>::del(TC
& obj
)
56 return next
->del(obj
);
57 return 0; //Can't find object in list.