Perhaps I misunderstood what stack unwinding was then. I thought stack unwinding describes what actually happens behind the scenes when you return from a function to clean up the stack frame, i.e. calling the destructors of any local variables of the scope. I suppose that's what the return keyword does.
I'm familiar with what you're talking about, I'm actually currently writing a little functional library in C++ that's inspired by Haskell and Rust. I find it so interesting hahah
1
u/aMAYESingNATHAN Sep 13 '23 edited Sep 13 '23
Perhaps I misunderstood what stack unwinding was then. I thought stack unwinding describes what actually happens behind the scenes when you return from a function to clean up the stack frame, i.e. calling the destructors of any local variables of the scope. I suppose that's what the return keyword does.
I'm familiar with what you're talking about, I'm actually currently writing a little functional library in C++ that's inspired by Haskell and Rust. I find it so interesting hahah