When a local variable goes out of scope it is destructed. If you want a local variable to be destructed earlier than the end of the function or other block of code it is declared in, just add an extra scope. One possible example is a file stream. Since the file stream is closed automatically when it goes out of scope, you might want to have it close earlier to free the memory used from opening the file. This example isn't really the best way to do things, since often it would be better to separate the lone function into multiple functions, but it demonstrates the idea.
Code:
void loadData(MyDataContainer& mdc)
{
{
std::ifstream ifs("LotsOfUserData.txt");
// ... read data into mdc
} // ifs goes out of scope and the first big file is closed.
{
std::ifstream ifs("LotsOfObjectData.txt");
// ... read data into mdc
} // ifs goes out of scope and the second big file is closed.
}