Well, you can't delete something that doesn't exist.
next needs to point either to 0 or to a valid address where a node object was previously constructed using new.
if I have an instance of myqueue<int>, and I call delete specifically on that instance of myqueue, will my myqueue destructors need to call delete specifically on myqueues members, because if the memory allocated for myqueue is freed, then shouldn't all the space requried for its data members be freed as well by default?
your problem is that you didn't set 'next' to NULL in the constructor (like node() : next(NULL) { }). So 'next' contains an undefined value and that if (next != NULL) doesn't help