Changeset ddbd52 in git for factory/templates/ftmpl_list.cc
- Timestamp:
- Mar 27, 1997, 11:31:57 AM (27 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 09a758aad44f63da7fe1dac3d01e5247cfaa1cdd
- Parents:
- 0bf9a278ad124abbaeec36c7244965e8baa71238
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/templates/ftmpl_list.cc
r0bf9a2 rddbd52 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: ftmpl_list.cc,v 1. 0 1996-05-17 11:06:32 stobbeExp $2 // $Id: ftmpl_list.cc,v 1.1 1997-03-27 10:31:57 schmidt Exp $ 3 3 4 4 /* 5 5 $Log: not supported by cvs2svn $ 6 Revision 1.0 1996/05/17 11:06:32 stobbe 7 Initial revision 8 6 9 */ 7 10 11 #include <templates/assert.h> 12 8 13 #include <templates/list.h> 9 10 14 11 15 template <class T> … … 75 79 } 76 80 81 #ifndef NOSTREAMIO 77 82 template <class T> 78 83 void ListItem<T>::print( ostream & os ) … … 83 88 os << "(no item)"; 84 89 } 90 #endif /* NOSTREAMIO */ 85 91 86 92 … … 201 207 } 202 208 } 203 204 209 210 205 211 template <class T> 206 212 void List<T>::insert ( const T& t, int (*cmpf)( const T&, const T& ), void (*insf)( T&, const T& ) ) … … 253 259 T List<T>::getFirst() const 254 260 { 255 if ( ! first ) 256 cerr << "List: no item available" << endl; 261 ASSERT( first, "List: no item available" ); 257 262 return first->getItem(); 258 263 } … … 281 286 T List<T>::getLast() const 282 287 { 283 if ( ! first ) 284 cerr << "List: no item available" << endl; 288 ASSERT( first, "List: no item available" ); 285 289 return last->getItem(); 286 290 } … … 328 332 329 333 334 #ifndef NOSTREAMIO 330 335 template <class T> 331 336 void List<T>::print ( ostream & os ) const … … 340 345 os << " )"; 341 346 } 347 #endif /* NOSTREAMIO */ 342 348 343 349 … … 393 399 T& ListIterator<T>::getItem () const 394 400 { 395 if ( current ) 396 return current->getItem(); 397 else { 398 cerr << "ListIterator: no item available" << endl; 399 return current->getItem(); 400 } 401 ASSERT( current, "ListIterator: no item available" ); 402 return current->getItem(); 401 403 } 402 404 … … 509 511 } 510 512 513 #ifndef NOSTREAMIO 511 514 template <class T> 512 515 ostream& operator<<( ostream & os, const List<T> & l ) … … 515 518 return os; 516 519 } 520 #endif /* NOSTREAMIO */ 517 521 518 522 template <class T>
Note: See TracChangeset
for help on using the changeset viewer.