Pizer’s Weblog

programming, DSP, math

Posts Tagged ‘RAII

scope guards revisited [C++0x style]

with 7 comments

If you havn’t heard about scope guards you might want to have a look at this ddj article. The idea of scope guards is to provide a convenient tool for resource management when exception safety is an issue. Of course you can always try to write little special-purpose classes and create instances on the stack so that some specific (“cleanup”) action is performed in the destructor. Sometimes it’s just tedious to have to write those special classes and you wish for a tool that lets you get away without them. That’s a situation where the scope guard idiom could help you.

Read the rest of this entry »

Written by pizer

November 22, 2008 at 3:42 pm

C versus C++

with 2 comments

I know that this is a sensitive subject that has been beaten to death already. Still, I’d like to share my opinion on this. Let me open with a quote by Bjarne Stroustrup about comparing programming languages which can be found in his FAQ:

Read the rest of this entry »

Written by pizer

October 29, 2008 at 4:20 pm