c++ example: function throw exception sample