I think that's the problem. So I'll have to find another way around it.Originally Posted by vart
I suppose you are allocating memory in your push_xxx functions
For such classes you have to provide copy constructors
If you don't - the compiler creates one for you - just using member by member assignments...
In this case all pointers point to the same memory as the original class instance,
And after the original class is destroyed - your copy has dangling pointer here and there...
With your function you invoke copy-constructor in the return statement from the the local variable to the temp-variable being returned...
After that the operator = is invoked to copy values from the temp variable to the newly created var in the calling function. It means this operator also should be provided



LinkBack URL
About LinkBacks



