T
Travis
So I had a Tree (custom written) that had, as a node type, as pretty
simple class. The class just stored some std::string's plus a void*.
So my tree instantiation use to be Tree <myClass *> myTree so adding a
new looked something like
myTree.Insert( new myClass( "string 1", "string 2", (void*) 2) ); //
seemed to work fine
Then I decided it was silly to store a tree of pionters, and changed
the tree to Tree <myClass> myTree so adding looked more like...
myTree.Insert( myClass( "string 1", "string 2", (void*) 2) ); //
crashes?
This insertion style compiles but the later one it crashes and I'm not
sure why. It would *appear* that the void* at some point goes NULL or
otherwise erroneous.
Just looking for some educated thoughts/opinions. Thanks.
simple class. The class just stored some std::string's plus a void*.
So my tree instantiation use to be Tree <myClass *> myTree so adding a
new looked something like
myTree.Insert( new myClass( "string 1", "string 2", (void*) 2) ); //
seemed to work fine
Then I decided it was silly to store a tree of pionters, and changed
the tree to Tree <myClass> myTree so adding looked more like...
myTree.Insert( myClass( "string 1", "string 2", (void*) 2) ); //
crashes?
This insertion style compiles but the later one it crashes and I'm not
sure why. It would *appear* that the void* at some point goes NULL or
otherwise erroneous.
Just looking for some educated thoughts/opinions. Thanks.