From 0763a73147604f326ff4800a294de42c9fb8e471 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 1 Nov 1996 16:48:31 +0000 Subject: [PATCH] flower-1.0.4 --- flower/plist.inl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 flower/plist.inl diff --git a/flower/plist.inl b/flower/plist.inl new file mode 100644 index 0000000000..fb18c87241 --- /dev/null +++ b/flower/plist.inl @@ -0,0 +1,43 @@ +/* -*-c++-*- + plist.inl -- part of flowerlib + + (c) 1996 Han-Wen Nienhuys& Jan Nieuwenhuizen +*/ + +#ifndef PLIST_INL +#define PLIST_INL + + + +template +inline +PointerList::~PointerList() +{ + Cursor next(*this); + for ( Cursor c( *this ); c.ok(); c = next ) { + next = c; + next++; + remove( c ); // PointerList::remove deletes the real data + } +} + +template +inline void +PointerList_print( PointerList const & l ) +{ + List& promises_to_be_const = (List&) l; + for ( Cursor c( promises_to_be_const ); c.ok(); c++ ) + (*c)->print(); +} + +template +inline void +PL_copy(PointerList &to,PointerList const&src) +{ + for (PCursor pc(src); pc.ok(); pc++) { + T q = pc; + T p=new typeof(*q) (*q) ; // argh, how do i do this in ANSI-C++ + to.bottom().add(p); + } +} +#endif -- 2.39.5