Changeset ddbd52 in git for factory


Ignore:
Timestamp:
Mar 27, 1997, 11:31:57 AM (27 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', '82fc009ea2b0098c1a4896c841bb70860976bdfc')
Children:
09a758aad44f63da7fe1dac3d01e5247cfaa1cdd
Parents:
0bf9a278ad124abbaeec36c7244965e8baa71238
Message:
stream-io wrapped by NOSTREAMIO
error check changed to ASSERT


git-svn-id: file:///usr/local/Singular/svn/trunk@111 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/templates/ftmpl_list.cc

    r0bf9a2 rddbd52  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: ftmpl_list.cc,v 1.0 1996-05-17 11:06:32 stobbe Exp $
     2// $Id: ftmpl_list.cc,v 1.1 1997-03-27 10:31:57 schmidt Exp $
    33
    44/*
    55$Log: not supported by cvs2svn $
     6Revision 1.0  1996/05/17 11:06:32  stobbe
     7Initial revision
     8
    69*/
    710
     11#include <templates/assert.h>
     12
    813#include <templates/list.h>
    9 
    1014
    1115template <class T>
     
    7579}
    7680
     81#ifndef NOSTREAMIO
    7782template <class T>
    7883void ListItem<T>::print( ostream & os )
     
    8388        os << "(no item)";
    8489}
     90#endif /* NOSTREAMIO */
    8591
    8692
     
    201207    }
    202208}
    203    
    204    
     209
     210
    205211template <class T>
    206212void List<T>::insert ( const T& t, int (*cmpf)( const T&, const T& ), void (*insf)( T&, const T& ) )
     
    253259T List<T>::getFirst() const
    254260{
    255     if ( ! first )
    256         cerr << "List: no item available" << endl;
     261    ASSERT( first, "List: no item available" );
    257262    return first->getItem();
    258263}
     
    281286T List<T>::getLast() const
    282287{
    283     if ( ! first )
    284         cerr << "List: no item available" << endl;
     288    ASSERT( first, "List: no item available" );
    285289    return last->getItem();
    286290}
     
    328332
    329333
     334#ifndef NOSTREAMIO
    330335template <class T>
    331336void List<T>::print ( ostream & os ) const
     
    340345    os << " )";
    341346}
     347#endif /* NOSTREAMIO */
    342348
    343349
     
    393399T& ListIterator<T>::getItem () const
    394400{
    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();
    401403}
    402404
     
    509511}
    510512
     513#ifndef NOSTREAMIO
    511514template <class T>
    512515ostream& operator<<( ostream & os, const List<T> & l )
     
    515518    return os;
    516519}
     520#endif /* NOSTREAMIO */
    517521
    518522template <class T>
Note: See TracChangeset for help on using the changeset viewer.