//queue.cpptemplate<class T>void Queue<T> ::m_copyElement (const Queue &queue){QueueItem<T> * scan = queue.m_head ;while (scan != NULL){push(scan ->m_item) ;scan = scan ->m_next ;}}template<class T> template<typename Iter>void Queue<T> ::m_copyElement (Iter beg, Iter end){while (beg != end){push(*beg) ;++beg ;}}template<class T>void Queue<T> ::m_destroy (void){while (!isEmpty()){pop() ;}}template<class T> template<typename Iter>Queue<T> ::Queue (Iter beg, Iter end): m_head(0), m_tail(0){m_copyElement(beg, end) ;}template<class T>Queue<T> ::Queue (const Queue & queue): m_head(0), m_tail(0){m_copyElement(queue) ;}template<class T>Queue<T> & Queue<T> ::operator = (const Queue & queue){m_destroy() ;m_copyElement(queue) ;return *this ;}template<class T>Queue<T> ::~Queue (void){m_destroy() ;}template<class T> template<typename Iter>void Queue<T> ::assign (Iter beg, Iter end){m_destroy() ;m_copyElement(beg, end) ;}template<class T>bool Queue<T> ::isEmpty (void) const{return NULL == m_head ;}template<class T>T & Queue<T> ::front (void){return m_head ->m_item ;}template<class T>const T & Queue<T> ::front (void) const{return m_head ->m_item ;}template<class T>void Queue<T> ::push (const T & item){QueueItem<T> * newItem = new QueueItem<T>(item) ;if (!isEmpty()){m_tail ->m_next = newItem ;m_tail = newItem ;}else{m_head = m_tail = newItem ;}}template<class T>void Queue<T> ::pop (void){QueueItem<T> * pTemp = m_head ;m_head = m_head ->m_next ;delete pTemp ;}