//	Header File:	linked.h
#include <iostream.h>
//using namespace std;

struct node
{
	int	data;
	node	*next;
};

class list{

friend ostream & operator<< (ostream &, list &);
friend class ListIterator;

public:
	list();	//Constructor
	list(const list &); //Copy Constructor
	~list(); //Destructor	
	
	// Mutators	
	list & add_front (const int);
	list & remove_front ();
	list & add_rear (const int);
	list & remove_rear ();

	// Inspector
	bool empty() const;
private:
	node *front;
	node *rear;
};

// Companion to class list
class ListIterator
{
public:
	ListIterator(const list &); //Constructor
	ListIterator(const ListIterator &); //Copy Constructor
	
	//"next" places data from current node into
	//parameter and advances current pointer
	//returns true if successful
	//false if at end of list
	bool next(int &);

private:
	node *current;
};
