@Acer it doesnt actually show you how to throw an exception in the second one. The comment just tells you it does (and references an example of a function which is known to throw system_error).
The function definition in CPP would never indicate directly that it can throw errors. You simply throw the error by calling "throw" inside the function when you write it to make the function throw an error.
@freemo
I am thinking that why the second one can throw error.