c++ is retarded

Deeko

Lifer
Jun 16, 2000
30,213
12
81
LinkedList<Mail> *ptr1 = Mail1->get_previous_node();
LinkedList<Mail> *ptr2 = Mail2->get_previous_node();

if(ptr1 != Mail2 && ptr2 != Mail1)
{
if(ptr1 != NULL)
ptr1->link(Mail2);

in a list where Mail1 is the first...thus ptr1 being NULL...it works fine right up until that last if statement. How does the line
if(ptr1 != NULL)
change ptr1 to point at Mail2 instead????
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Can you show the implementation of the template please? From what I can see it looks obvious, but it's hard to say without seeing the impl.