Hi all,
I'm working on a C# project, and at some point I'm needing to pass the
same stack to multiple functions.
I found out the hard way that when I poss a stack by value it doesn't
actually use a copy constructor to move the contents over to a new
stack - the original stack is still modified by changes to the stack
that was passed by value.
Looking at the MSDN page (http://msdn2.microsoft.com/en-us/library/
3278tedw.aspx) I don't see anything that explicitly says it's (un)safe
to pass by reference.
My question: is there an easy way to copy this stack to a new one
without creating my own "stack copy" function?
Also: In the future, how can I tell if it is safe to pass *and modify*
a stack to a new function?
Thanks,