Is there any case in which putting code within brackets to reduce its scope is something that I might want to do, or is this one of those cases in which you guys will tell m
I have found another use case in my own code: unit testing destructors. Example using UnitTest++ (but the same principle applies regardless of unit testing framework):
TEST(SomeTest)
{
{
SomeClass someObject;
} // someObject is destroyed
CHECK(isSomeClassDestructorWorking())
// e.g. have all resources been freed up?
}