summaryrefslogtreecommitdiff
path: root/flower/include/killing-cons.tcc
blob: 8c6c04e9983b3b731ae7558132b63d6ab591f161 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*   
  killing-cons.tcc -- declare Killing_cons
  
  source file of the GNU LilyPond music typesetter
  
  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  
 */

#ifndef KILLING_CONS_TCC
#define KILLING_CONS_TCC

#include "cons.hh"

template<class T>
Killing_cons<T>::~Killing_cons ()
{
  delete car_p_;
}

template<class T>
void 
copy_killing_cons_list (Cons_list<T> &dest, Cons<T> *src) 
{
  for (; src; src  = src->next_cons_p_)
    {
      T *t = new T(*src->car_p_);
      dest.append ( new Killing_cons<T> (t, 0));
    }
}

template<class T>
void
clone_killing_cons_list (Cons_list<T> & dest, Cons<T> *src)
{
  for (; src; src  = src->next_cons_p_)
    {
      T *t = src->car_p_->clone ();
      dest.append (new Killing_cons<T> (t, 0));      
    }
}

#endif /* KILLING_CONS_TCC */