Take a look at your copy constructor:
Node(const Node &p) {
move = ""; //!< change this to p.move
memcpy(state,p.state,sizeof(int)*10);
}
Node(const Node &p) {
move = ""; //!< change this to p.move
memcpy(state,p.state,sizeof(int)*10);
}
To copy to clipboard, switch view to plain text mode
When you take out an object from vector, it's copy is made and previously assigned string is cleared in your copy-constructor.
------------------
ok, maybe i was not clear enough, i mean this line:
Node t = n.GetChild(n.GetCount() - 1);
Node t = n.GetChild(n.GetCount() - 1);
To copy to clipboard, switch view to plain text mode
this is copy - construction, its not the same as:
Node t;
t = n.GetChild(n.GetCount() - 1);
Node t;
t = n.GetChild(n.GetCount() - 1);
To copy to clipboard, switch view to plain text mode
Assignment operator is not called anywhere in your code ( add cout's to see it yourself ).
Bookmarks