]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/plist.tcc
release: 0.1.61
[lilypond.git] / flower / include / plist.tcc
index f7733d508d0e77b8bba75eadd00554cc9c7c3170..794e0b0fc1f0a03faf180b2d60b9b7a015116acd 100644 (file)
@@ -1,27 +1,42 @@
+/*
+  plist.tcc -- implement Pointer_list
+
+  source file of the Flower Library
+
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef PLIST_TCC
+#define PLIST_TCC
+
 #include "plist.hh"
 
-#define PL_INSTANTIATE(a) class Link_list<a*>; \
-       template class PCursor<a*>;
-#define IPL_INSTANTIATE(a) PL_INSTANTIATE(a); \
-       template class Pointer_list<a*>
-       
 template<class T>
 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> 
-Link_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