Showing content from https://github.com/fmtlib/fmt/issues/4203 below:
Exception formatting is undocumented · Issue #4203 · fmtlib/fmt · GitHub
Formatting for exceptions exists (e.g. via #3062 or #3076).
This is not documented (missing in the list at
<a id="std-api"></a> ## Standard Library Types Formatting `fmt/std.h` provides formatters for: - [`std::atomic`](https://en.cppreference.com/w/cpp/atomic/atomic) - [`std::atomic_flag`](https://en.cppreference.com/w/cpp/atomic/atomic_flag) - [`std::bitset`](https://en.cppreference.com/w/cpp/utility/bitset) - [`std::error_code`](https://en.cppreference.com/w/cpp/error/error_code) - [`std::filesystem::path`](https://en.cppreference.com/w/cpp/filesystem/path) - [`std::monostate`](https://en.cppreference.com/w/cpp/utility/variant/monostate) - [`std::optional`](https://en.cppreference.com/w/cpp/utility/optional) - [`std::source_location`](https://en.cppreference.com/w/cpp/utility/source_location) - [`std::thread::id`](https://en.cppreference.com/w/cpp/thread/thread/id) - [`std::variant`](https://en.cppreference.com/w/cpp/utility/variant/variant)
).
Additionally, there seem to be different ways to format exceptions (without any specified and with {:t}
), as can be seen from the tests:
try { using namespace my_ns1::my_ns2; throw my_exception("My Exception"); } catch (const std::exception& ex) { EXPECT_EQ("my_ns1::my_ns2::my_exception: My Exception", fmt::format("{:t}", ex)); EXPECT_EQ("My Exception", fmt::format("{:}", ex)); }
This is undocumented in https://github.com/fmtlib/fmt/blob/cc2ba8f9ede4e5ae3262f43f3e4d07a22a9acdfc/doc/syntax.md. The only reference in the docs to t
is A horizontal-tab character.
for chrono
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4