The constructor List
template < class List_entry >
List < List_entry > :: List( )
{
count = 0;
}
clear
template < class List_entry >
voidList < List_entry > :: clear( )
{
count = 0;
}
empty
template < class List_entry >
boolList < List_entry > :: empty( ) const
{
return count <=0;
}
full
template < class List_entry >
boolList < List_entry > :: full( ) const
{
return count >=max_list;
}
replace
template < class List_entry >
Error_code List < List_entry > :: replace( int position , const List_entry &x)
{
if (position < 0 || position >=count) return range_error ;
entry[position ] = x;
return success;
}
retrieve
template < class List_entry >
Error_code List < List_entry > :: retrieve( int position , List_entry &x) const
{
if (position < 0 || position >=count) return range_error ;
x = entry[position ];
return success;
}