Exceptions are not supported, as they are not formattable:
int main() try {
std::vector <int> vec;
vec.at(42);
} catch(const std::out_of_range& ex){
fmt::print("{}", ex);
}
https://godbolt.org/z/ejTMEYr3b
In practice, the expected/desired behavior would be to print the error message.
Ie if they would behave as-if
int main() try {
std::vector<int> vec;
vec.at(42);
} catch(const std::out_of_range& ex){
fmt::print("{}", ex.what());
}
This can be accomplished by defining a custom formatter for std::exception, but as fmt already provides formatters for many/most types from the standard library, support for std::exception should be part of it.
Exceptions are not supported, as they are not formattable:
https://godbolt.org/z/ejTMEYr3b
In practice, the expected/desired behavior would be to print the error message.
Ie if they would behave as-if
This can be accomplished by defining a custom formatter for
std::exception, but asfmtalready provides formatters for many/most types from the standard library, support for std::exception should be part of it.