I
Ian Collins
Le 23/06/12 00:21, Ian Collins a écrit :
It is difficult to understand, maybe because "s" is undefined
ManageSomething(Something s) looks like a function call but probably
isn't one since you are declaring a struct, so it must be a declaration
of a constructor. Yes, and then a further function call (or similar)
separated by a colon. Mmmm I have seen that sometimes in C++ code
and "thing" is a "Something" so that must be a function call?
Or not?
You can be worried, I do not parse all that and I do not care actually
to parse that.
Somewhat disingenuous coming from someone who claims to be paid to
maintain C++ code don't you think?
Yes. Up to 30% or more of space are now taken by tables describing the
stack movements to the unwinding virtual machine that the C++ run time
needs.
Now where did you dig up that "fact" from? Automatic destruction works
perfectly well without run time support.
But this has no sense Ian. Keep C++. I will go on developing simple
solutions to simple problems. A stack is a stack, and I prefer pushing
the things to cleanup into a stack with:
pushCleanup( Opcode,pointer);
each time I need to cleanup something, and then I just write:
UnwindCleanupStack();
and I am done. And I write pushCleanup() and Unwind once and I can
use them again and again.
I prefer to let the compiler do the pushing and popping for me. Lazy?
maybe, but I know the compiler won't have a bad hair day and forget to
pop something.