]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/killing-cons.tcc
release: 1.1.30
[lilypond.git] / lily / include / killing-cons.tcc
1 /*   
2   killing-cons.tcc -- declare Killing_cons
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef KILLING_CONS_TCC
11 #define KILLING_CONS_TCC
12
13
14 template<class T>
15 Killing_cons<T>::~Killing_cons ()
16 {
17   delete car_;
18 }
19
20 template<class T>
21 Cons_list<T>
22 copy_killing_cons_list (Cons<T> *src)
23 {
24   Cons_list<T> kl;
25
26   for (; src; src  = src->next_)
27     {
28       T *t = new T(*src->car_);
29       *kl.tail_ = new Killing_cons<T> (t, 0);
30       kl.tail_ = &(*kl.tail_)->next_;
31     }
32   
33   return kl;
34 }
35
36 template<class T>
37 Cons_list<T>
38 clone_killing_cons_list (Cons<T> *src)
39 {
40   Cons_list<T> kl;
41
42   for (; src; src  = src->next_)
43     {
44       T *t = src->car_->clone ();
45       *kl.tail_ = new Killing_cons<T> (t, 0);
46       kl.tail_ = &(*kl.pp)->next_;
47     }
48   
49   return kl;
50 }
51
52
53 #endif /* KILLING_CONS_TCC */
54