>>83-85 I feel I'm being [spoiled]trolled[/spoiled].
>>71 said that I, personally, don't need smart pointers in C because "there's no such thing as exceptions". Being a professional C programmer, I was deeply offended by such a moronic statement.
Exception mechanism is merely a tool that provides one particular way for solving a certain class of problems. Not having this exact tool only means that I have to implement the solution in a slightly different way. I open a file, try to read something from it unsuccessfully and then need to close it before reporting error myself, with exceptions I put
close in the
finally block, without exceptions I make a "finally" label near the end of the function, close the file there, and set up return value and
goto there whenever something fails.
The problem I'm solving is the same, the structure of the solution is roughly the same, and only the thin layer of syntax and semantics of an actual language produces somewhat different implementation.
I'm greatly saddened by the stupidity and arrogance of
>>71,83-85, who not only can't see beneath that superficial layer, but are entirely convinced that there is
nothing at all beyond that.
Of course I'd need more than one logical exit point in a function if it can fail somewhere. Of course I'd have to map these onto the real exit point(s) somehow and clean up all resources, and why the fuck anyone would think that 'throw' is somehow different from 'return' in this respect? Of course I would appreciate RAII greatly while I'm at it.