Templated queue implementation I wrote an implementation for a simple queue in C++ (for practice, since there's an stl queue).  I've been trying to focus on memory management and the rule of three.  Any suggestions/improvements?

(Personally, I feel like there has to be a better way to overload the copy assignment operator).

#ifndef QUEUE_H
#define QUEUE_H

#include "assert.h"

#define NULL 0


template &lt;typename T&gt;
class Queue
{
 public:
  Queue();
  Queue(const Queue&amp; other);
  ~Queue();

  void enqueue(T data);
  T    dequeue();

  bool isEmpty() { return (front_ == back_); }

  Queue&amp; operator=(const Queue&amp; other);

 private:
  struct node
  {
    T     data;
    node* next;
  };

  node* front_;
  node* back_;
};


template &lt;typename T&gt;
Queue&lt;T&gt;::Queue()
{
  front_ = new node();
  back_  = front_;
}


template &lt;typename T&gt;
Queue&lt;T&gt;::Queue(const Queue&lt;T&gt;&amp; other)
{
  front_     = new node();
  back_      = front_;
  node* temp = other.front_;

  while (temp != other.back_)
  {
    enqueue(temp-&gt;data);
    temp = temp-&gt;next;
  }
}


template &lt;typename T&gt;
Queue&lt;T&gt;::~Queue()
{
  while (!isEmpty()) { dequeue(); }
}


template &lt;typename T&gt;
void Queue&lt;T&gt;::enqueue(T data)
{
  back_-&gt;data = data;
  back_-&gt;next = new node();
  back_       = back_-&gt;next;
}


template &lt;typename T&gt;
T Queue&lt;T&gt;::dequeue()
{ 
  assert(!isEmpty());

  node* temp = front_;
  T     data = front_-&gt;data;  
  front_     = front_-&gt;next;

  delete temp;
  return data;
}


template &lt;typename T&gt;
Queue&lt;T&gt;&amp; Queue&lt;T&gt;::operator=(const Queue&lt;T&gt;&amp; other)
{
  if (this != &amp;other)
  {
    node* temp = other.front_;

    while (!isEmpty()) { dequeue(); }
    while (temp != other.back_)
    {
      enqueue(temp-&gt;data);
      temp  = temp-&gt;next;
    }
  }
  return *this;
}

#endif
Use the correct headers

#include "assert.h"


should be

#include &lt;cassert&gt;


since you're writing C++. C++ provides special headers for all C headers, they generally start with a 'c' and have the '.h' removed at the end. Prefer these.

Also system headers, should always use &lt;&gt; rather than "".

Your definition of NULL is unsafe

NULL is typically reserved to use in the context of pointers. Defining NULL as you do means that NULL is not of a pointer type and you can pass NULL as an integer for example this is not desirable.

If you must define NULL you should do it like this:

#ifndef NULL
#define NULL (reinterpret_cast&lt;void*&gt;(0))
#endif


but really most likely it is already included by one of your other headers (&lt;cstddef&gt;, &lt;clocale&gt;, &lt;cstdio&gt;, &lt;cstdlib&gt;, &lt;cstring&gt;, &lt;ctime&gt; and anything that includes those, so pretty much everything). 

If you are using C++11 or newer you should use nullptr instead of NULL.

Style

I personally would name node with the same convention as your other classes, Node. I'm also not a big fan of using _ as a suffix for class members but that is personal taste.

Pass template arguments by constant reference

As T can be just about anything, you should pass all Ts by const reference (const T&amp;) to avoid possibly expensive copies. 

Const correctness

Methods that do not modify the state of the queue should be declared const.

bool isEmpty()


should be

bool isEmpty() const


being const correct allows you to get compile time errors if you unintentionally modify something you didn't intend to. It's a good habit.

Construct objects as close as possible to their final state

Your node class should have a constructor that initialises the data member. This will reduce some code for you.

Put the sentinel in the class.

Allocating the sentinel node on the heap in your constructor is unnecessary. Prefer to have it be a member variable. It is a good practice to not allocate on the heap when it suffices to use a local or member variable.

Avoid code duplication

The copy constructor and copy assignment operator are typical places where one usually gets code duplication. 

I would suggest using the Copy and Swap Idiom for implementing the assignment operator. 

And welcome to the site!