Re: Go ahead. Stop programming. This ensures you from any mistakes.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Anyway, RAII dow not address the problem of partially created objects.

Why ? Partially constructed objects will be destroyed partially - if you
are using RAII and not plain pointers.

RAII is very powerfull. One of the (only) reasons I still use C++.


How does RAII knows how far the resourse allocation has reached? How does it
jump to the point in the destructor to free only the allocated objects? The
case switch is ideal to jump to that point.

That was the origin of this discussion branch. BTW, those who thing that the
'switch' is an n-ary variation of bivalent 'if', it would be more
reasonable embrace the conditional code into {} as it matches in Pascal
rather than using 'break's, which are loop-breaking statements. The code in
loops is normally "falls through" from one instruction to the following.


.