Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualDaDweeDow

Posted 13 February 2013 - 09:44 AM

Is there a copy constructor on the Nodes?  Not sure what would cause this but that's the only thing I can think of, everything else looks pretty typical.  

 

Edit:

Check assignment constructor also.  Failing that you could just break on it in the debugger and just keep clicking "step into" through all the compiler mumbo jumbo to see if anything comes up.  

 

Edit #2 (for reals this time) :

It's an assignment operator, not a constructor.   I think that's what's broken, there's a typo in there that's keeping stuff from getting moved over.  vector.erase(iter) moves everything after iter over, and iter is basically just a pointer.  If this is no good, you can use a vector of pointers to Nodes, or a std::list of nodes (I'm not sure that's guaranteed not to copy on erase, but I have never seen it do it).  


#2DaDweeDow

Posted 13 February 2013 - 09:18 AM

Is there a copy constructor on the Nodes?  Not sure what would cause this but that's the only thing I can think of, everything else looks pretty typical.  

 

Edit:

Check assignment constructor also.  Failing that you could just break on it in the debugger and just keep clicking "step into" through all the compiler mumbo jumbo to see if anything comes up.  


#1DaDweeDow

Posted 13 February 2013 - 09:10 AM

Is there a copy constructor on the Nodes?  Not sure what would cause this but that's the only thing I can think of, everything else looks pretty typical.  


PARTNERS