Humam Helfawi
Humam Helfawi

Reputation: 20264

What is happening in the Curly Braces

As I know, } contains in actual some operation like destroying the stack allocated objects because when some error is happening in the destructor of an object, VS.NET point me to the closing of the Curly Braces and even you can step into it using F11 and see what is happening in the destructors that have been called. However, I have notice that the { is also an operation and if I try to step into it using F11, VS.NET tell me that it need memset.asm file in order to contiune debugin.

What is really happening inside {?

Upvotes: 0

Views: 372

Answers (1)

markshancock
markshancock

Reputation: 690

Curly braces establish scope and lifetime. Objects created within a pair of curly braces are not accessible outside of them. They are not code; but, since the objects will likely be freed when you exit them, the compiler may produce code as a result of the closing curly brace.

Regarding stepping into the opening curly brace, you are actually stepping into the first executable line of code within the curly brace. That line of code would explain why the debugger is trying to step into memset.asm.

Upvotes: 2

Related Questions