Added std::type_info formatter (#3978)

* Added std::type_info formatter;
* Reused std::type_info formatter in std::exception formatters;
* Updated MSVC std::type_info outputting to exclude all class, struct and enum occurences.
This commit is contained in:
Matthias Moulin
2024-05-28 19:57:08 +02:00
committed by GitHub
parent e721046e27
commit 728f9bc388
2 changed files with 101 additions and 56 deletions

View File

@@ -300,6 +300,13 @@ TEST(std_test, exception) {
#endif
}
#if FMT_USE_RTTI
TEST(std_test, type_info) {
EXPECT_EQ(fmt::format("{}", typeid(std::runtime_error)),
"std::runtime_error");
}
#endif
TEST(std_test, format_bit_reference) {
std::bitset<2> bs(1);
EXPECT_EQ(fmt::format("{} {}", bs[0], bs[1]), "true false");