template<class node_entry>
struct node
{ node_entry entry;
node<node_entry>*next;
node();
node(node_entry,node<node_entry>*link=NULL);
};
template<class List_entry>
class List
{
public:
~List();
List(const List<List_entry>©);
void operator=(const List<List_entry>©);
protected:
int count;
node<List_entry>*head;
node<List_entry>*set_position(int position) const;
};
template<class List_entry>
Error_code List<List_entry>::remove(int position,const List_entry&x);
if(position<1 || position>count)
return range error;
node<List_entry>*new_node,*previous,*following,*present;
if(new_node==NULL)
return overflow;
else
{new_node=present-->link;
present-->link=new_node-->link;
previous-->link=position-->link;
free( present);
return 0;
}