source file of the Flower Library
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#ifndef LIST_CC
#define LIST_CC
-// instantiate a template: explicit instantiation.
-#define LIST_INSTANTIATE(a) class List<a>; template class Cursor<a>; \
- template class Link<a>
-
#include "list.hh"
template<class T>
List<T>::add (T const & thing, Cursor<T> &after_me)
{
if (!size_) { // not much choice if list is empty
- bottom_ = top_ = new Link<T>( thing);
+ bottom_ = top_ = new Link<T>(thing);
if (!after_me.ok())
after_me = bottom();
}
{
if (!size_)
{
- bottom_ = top_ = new Link<T>( thing);
+ bottom_ = top_ = new Link<T>(thing);
if (!before_me.ok())
before_me = top();
b++;
}
}
+
+#ifndef __CYGWIN32__ // ugh should check for some gcc/egcs version
+
+// instantiate a template: explicit instantiation.
+#define LIST_INSTANTIATE(a) template class List<a>; \
+ template class Cursor<a>; template class Link<a>
+
+#else
+
+#define LIST_INSTANTIATE(T)\
+ static void force_list_members ()\
+ {\
+ List<T> bla;\
+ bla.top().add ((void*)0);\
+ }
#endif
+
+#endif
+