This code uses the Try Block function , which is a special syntax that allows you to insert the entire piece of the function into the try / catch block (mostly useful for the class to eliminate exceptions thrown by constructors of base or member sub-objects).
In addition, main() is the only return function that does not need to explicitly return a value. If no return value is specified, 0 assumed.
In clause 3.6.1 / 5 of the C ++ 11 standard:
The return statement in main has the effect of exiting the main function (destroying any objects using automatic storage time) and calling std::exit with the return value as an argument. If control reaches the main goal without encountering a return statement, the effect is to execute
return 0;
source share