]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/plist.tcc
release: 1.1.32
[lilypond.git] / flower / include / plist.tcc
index 7129cdbe3d2027ba1fd44b6941005c32a2dbe077..24db16f85daa2c0f94fa18d736824d7a1c27f54b 100644 (file)
@@ -1,26 +1,42 @@
+/*
+  plist.tcc -- implement Pointer_list
+
+  source file of the Flower Library
+
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef PLIST_TCC
+#define PLIST_TCC
+
 #include "plist.hh"
 
-#define PL_instantiate(a)  template class Pointer_list<a*>; \
-       template class PCursor<a*>;
-#define IPL_instantiate(a) PL_instantiate(a); \
-       template class IPointer_list<a*>
-       
 template<class T>
-IPointer_list<T>::~IPointer_list()
+void
+Pointer_list<T>::junk()
 {
-    PCursor<T> c( *this );
-    while (c.ok()) {
+  PCursor<T> c (*this);
+  while (c.ok()) 
+    {
        delete c.remove_p();
     }
 }
 
-template<class T>
-PCursor<T> 
-Pointer_list<T>::find(T what ) const
-{
-    PCursor<T> i(*this);
-    for (; i.ok(); i++)
-       if (i.ptr() == what)
-          break;
-    return i;    
-}
+#ifndef __CYGWIN32__ // ugh should check for some gcc/egcs version
+
+#define POINTERLIST_INSTANTIATE(a) template class Pointer_list<a*>;\
+       template class PCursor<a*>;
+
+#else
+
+#define POINTERLIST_INSTANTIATE(T)\
+    static void force_junk##T ()\
+    {\
+    Pointer_list<T*> bla;\
+    bla.junk ();\
+    }
+
+#endif
+
+#endif // PLIST_TCC