Show how to use format xtd::format class with exceptions.
#include <xtd/console>
#include <xtd/environment>
#include <xtd/system_exception>
#include <xtd/argument_out_of_range_exception>
#include <xtd/string>
auto main() -> int {
console::out << string::format("{}", std::exception()) << environment::new_line;
console::out << string::format("{}", std::invalid_argument("Invalid argument")) << environment::new_line;
console::out << string::format(
"{}",
system_exception(
"System exception")) << environment::new_line;
}
The exception that is thrown when one of the arguments provided to a method is out of range.
Definition argument_out_of_range_exception.hpp:23
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.hpp:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10