mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-30 16:26:27 +08:00
Compare commits
5 Commits
b7fb3c686e
...
89bb4b5dd1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89bb4b5dd1 | ||
|
|
caf5e48b1c | ||
|
|
2a2d9edb25 | ||
|
|
90567e92d4 | ||
|
|
c851fbe658 |
67
ChangeLog.md
67
ChangeLog.md
@ -1,3 +1,70 @@
|
||||
# 12.2.1 - TBD
|
||||
|
||||
- Added a formatter for `std::exception_ptr` that formats the referenced
|
||||
exception (or `none` when null)
|
||||
(https://github.com/fmtlib/fmt/issues/4808,
|
||||
https://github.com/fmtlib/fmt/pull/4819).
|
||||
Thanks @avikivity and @Atlas-Zero.
|
||||
|
||||
- Added unwinding of nested exceptions created via
|
||||
`std::throw_with_nested` to the `std::exception` formatter, joining each
|
||||
level with `": "` (https://github.com/fmtlib/fmt/pull/4844).
|
||||
Thanks @avikivity.
|
||||
|
||||
- Exported the ostream formatters (`fmt::basic_ostream_formatter`,
|
||||
`fmt::ostream_formatter`) and `fmt::streamed` from the C++20 module
|
||||
(https://github.com/fmtlib/fmt/pull/4861). Thanks @avikivity.
|
||||
|
||||
- Optimized 128-bit integer formatting by reducing the value to 64-bit
|
||||
chunks instead of doing repeated 128-bit division, giving a ~5x speedup
|
||||
on full-range values.
|
||||
|
||||
- Fixed handling of out-of-range floating-point durations in chrono
|
||||
formatting (https://github.com/fmtlib/fmt/pull/4802). Thanks @aizu-m.
|
||||
|
||||
- Fixed a hang and assertion failure when printing to a pipe whose read
|
||||
end is closed (https://github.com/fmtlib/fmt/issues/4797).
|
||||
Thanks @nikola-sh.
|
||||
|
||||
- Fixed formatting of out-of-range integers with the `c` presentation
|
||||
type, which previously mangled negative values and silently truncated
|
||||
out-of-range ones (https://github.com/fmtlib/fmt/issues/4839).
|
||||
Thanks @igoloe.
|
||||
|
||||
- Fixed an `FMT_COMPILE` failure for user-defined types formatted via
|
||||
`format_as` (https://github.com/fmtlib/fmt/issues/4794,
|
||||
https://github.com/fmtlib/fmt/pull/4836).
|
||||
Thanks @mjerabek and @upadhyay74aman.
|
||||
|
||||
- Fixed the fallback `uint128` bitwise-not implementation
|
||||
(https://github.com/fmtlib/fmt/pull/4813). Thanks @Vcode2407.
|
||||
|
||||
- Fixed a false positive in `fmt::is_contiguous` by explicitly checking
|
||||
for `operator[]` on the container itself
|
||||
(https://github.com/fmtlib/fmt/pull/4825). Thanks @tearfur.
|
||||
|
||||
- Generated the build-tree CMake export set regardless of `FMT_INSTALL`,
|
||||
so projects consuming {fmt} via `add_subdirectory` or `FetchContent` can
|
||||
export their own `fmt::*`-dependent targets
|
||||
(https://github.com/fmtlib/fmt/issues/4806,
|
||||
https://github.com/fmtlib/fmt/pull/4850). Thanks @Krzmbrzl and @hexonal.
|
||||
|
||||
- Made the `fmt-c` library respect `BUILD_SHARED_LIBS` like the main
|
||||
{fmt} library (https://github.com/fmtlib/fmt/pull/4812). Thanks @jengelh.
|
||||
|
||||
- Skipped `VERSION`/`SOVERSION`/`DEBUG_POSTFIX` on the header-only
|
||||
`INTERFACE` target (https://github.com/fmtlib/fmt/pull/4830).
|
||||
Thanks @soumik15630m.
|
||||
|
||||
- Suppressed the MSVC C4702 (unreachable code) warning
|
||||
(https://github.com/fmtlib/fmt/pull/4822). Thanks @torsten48.
|
||||
|
||||
- Documented that the hexfloat `a`/`A` presentation types always emit the
|
||||
`0x` prefix (https://github.com/fmtlib/fmt/pull/4862). Thanks @ny000815.
|
||||
|
||||
- Fixed a minor formatting issue in the documentation
|
||||
(https://github.com/fmtlib/fmt/pull/4826). Thanks @brooklynwidz.
|
||||
|
||||
# 12.2.0 - 2026-06-16
|
||||
|
||||
- Added a C11 API that brings fast, type-safe formatting to C. The new
|
||||
|
||||
@ -165,7 +165,6 @@ void println(std::ostream& os, format_string<T...> fmt, T&&... args) {
|
||||
}
|
||||
|
||||
FMT_END_EXPORT
|
||||
|
||||
FMT_END_NAMESPACE
|
||||
|
||||
#endif // FMT_OSTREAM_H_
|
||||
|
||||
@ -19,6 +19,5 @@ endif ()
|
||||
# Test that a target depending on fmt can itself be exported (#4806).
|
||||
add_library(export-test INTERFACE)
|
||||
target_link_libraries(export-test INTERFACE fmt::fmt)
|
||||
export(
|
||||
TARGETS export-test
|
||||
FILE ${CMAKE_CURRENT_BINARY_DIR}/export-test-targets.cmake)
|
||||
export(TARGETS export-test
|
||||
FILE ${CMAKE_CURRENT_BINARY_DIR}/export-test-targets.cmake)
|
||||
|
||||
@ -480,12 +480,13 @@ TEST(compile_test, constexpr_string_format) {
|
||||
}
|
||||
#endif // FMT_USE_CONSTEXPR_STRING
|
||||
|
||||
namespace {
|
||||
struct compile_format_as_type {
|
||||
struct type_with_format_as {
|
||||
int value;
|
||||
};
|
||||
int format_as(compile_format_as_type f) { return f.value; }
|
||||
}
|
||||
int format_as(type_with_format_as v) { return v.value; }
|
||||
|
||||
TEST(compile_test, format_as) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), compile_format_as_type{42}));
|
||||
}
|
||||
// Use a format string other than "{}" so that formatting goes through the
|
||||
// compiled field path rather than the to_string fast path.
|
||||
EXPECT_EQ("[42]", fmt::format(FMT_COMPILE("[{}]"), type_with_format_as{42}));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user