Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bump
Created with
brew bump-formula-pr
.release notes
Optimized includes in other headers such as
fmt/format.h
which is now roughly equivalent to the oldfmt/core.h
in terms of build speed.Migrated the documentation at https://fmt.dev/ from Sphinx to MkDocs.
Improved C++20 module support (Use native c++ module support from CMake fmtlib/fmt#3990, Use native c++ module support from CMake fmtlib/fmt#3991, Build issue with WinLibs GCC on Windows after C++20 modules update fmtlib/fmt#3993, Fix missing includes in fmt.cc fmtlib/fmt#3994, Fix build with
FMT_MODULE=OFF
fmtlib/fmt#3997, FixFMT_INSTALL
withFMT_MODULE
fmtlib/fmt#3998, Don't addos.cc
to sources withFMT_MODULE
fmtlib/fmt#4004, Check if.cc
exists infmt.cc
fmtlib/fmt#4005, Guard more system headers byFMT_MODULE
fmtlib/fmt#4006, Only installFILE_SET
when needed fmtlib/fmt#4013, Defines are still needed for FMT_MODULE as well fmtlib/fmt#4027, Module purview can only contain direct preprocessor code fmtlib/fmt#4029). In particular, native CMake support for modules is now used if available. Thanks @yujincheng08 and @matt77hias.Added an option to replace standard includes with
import std
enabled via theFMT_IMPORT_STD
macro (MSVC errors when importing both fmt and std modules fmtlib/fmt#3921, Added FMT_IMPORT_STD feature macro fmtlib/fmt#3928). Thanks @matt77hias.Exported
fmt::range_format
,fmt::range_format_kind
andfmt::compiled_string
from thefmt
module (Added FMT_EXPORT to fmt::range_format and fmt::range_format_kind fmtlib/fmt#3970, Exportcompiled_string
so that user can customize one fmtlib/fmt#3999). Thanks @matt77hias and @yujincheng08.Improved integration with stdio in
fmt::print
, enabling direct writes into a C stream buffer in common cases. This may give significant performance improvements ranging from tens of percent to 2x and eliminates dynamic memory allocations on the buffer level. It is currently enabled for built-in and string types with wider availability coming up in future releases.For example, it gives ~24% improvement on a simple benchmark compiled with Apple clang version 15.0.0 (clang-1500.1.0.2.5) and run on macOS 14.2.1:
Improved safety of
fmt::format_to
when writing to an array (🛠 Add basic array safety functions and backwards-compatible result type fmtlib/fmt#3805). For example (godbolt):no longer results in a buffer overflow. Instead the output will be truncated and you can get the end iterator and whether truncation occurred from the
result
object. Thanks @ThePhD.Enabled Unicode support by default in MSVC, bringing it on par with other compilers and making it unnecessary for users to enable it explicitly. Most of {fmt} is encoding-agnostic but this prevents mojibake in places where encoding matters such as path formatting and terminal output. You can control the Unicode support via the CMake
FMT_UNICODE
option. Note that some {fmt} packages such as the one in vcpkg have already been compiled with Unicode enabled.Added a formatter for
std::expected
(added formatter for std::expected fmtlib/fmt#3834). Thanks @dominicpoeschko.Added a formatter for
std::complex
(flexible std::complex formatter fmtlib/fmt#1467, Add support for std::complex fmtlib/fmt#3886, Add std::complex formatter fmtlib/fmt#3892, Improve std::complex formatter to be compatible with P2197R0 fmtlib/fmt#3900). Thanks @phprus.Added a formatter for
std::type_info
(Added std::type_info formatter fmtlib/fmt#3978). Thanks @matt77hias.Specialized
formatter
forstd::basic_string
types with custom traits and allocators (Formatting for strings with custom allocators fails to compile fmtlib/fmt#3938, Specializeformatter
for allstd::basic_string
types fmtlib/fmt#3943). Thanks @dieram3.Added formatters for
std::chrono::day
,std::chrono::month
,std::chrono::year
andstd::chrono::year_month_day
(Green Day Support fmtlib/fmt#3758, Add support forstd::chrono::year_month_day
fmtlib/fmt#3772, Implemented fmt::day, fmt::month, fmt::year and related unit tests fmtlib/fmt#3906, implement year_month_day fmtlib/fmt#3913). For example:prints a green day:
Thanks @zivshek.
Fixed handling of precision in
%S
(%S ignores precision for chrono durations where the decimal part should have been only zeros fmtlib/fmt#3794, Fix %S formatting for chrono durations with leading zeroes fmtlib/fmt#3814). Thanks @js324.Added support for the
-
specifier (glibcstrftime
extension) to day of the month (%d
) and week of the year (%W
,%U
,%V
) specifiers (Add glibc ext for day of month and week of year fmtlib/fmt#3976). Thanks @ZaheenJ.Fixed the scope of the
-
extension in chrono formatting so that it doesn't apply to subsequent specifiers (chrono glibc '-' ext applies to following components within a spec fmtlib/fmt#3811, Fix scope for glibc ext for sec, min, and hour fmtlib/fmt#3812). Thanks @phprus.Improved handling of
time_point::min()
(fmt chrono fails for clock minimum value fmtlib/fmt#3282).Added support for character range formatting (support C++23 character range formatting fmtlib/fmt#3857, Support character range formatting fmtlib/fmt#3863). Thanks @js324.
Added
string
anddebug_string
range formatters (Added range_format::string formatter fmtlib/fmt#3973, Added missing std::declval for non-default-constructible types fmtlib/fmt#4024). Thanks @matt77hias.Enabled ADL for
begin
andend
infmt::join
(join does not use ADL on begin/end of its ranges fmtlib/fmt#3813, Consider ADL begin() and end() when joining ranges fmtlib/fmt#3824). Thanks @bbolli.Made contiguous iterator optimizations apply to
std::basic_string
iterators (Add fmt::is_contiguous<std::basic_string<Char, Traits, Allocator>> fmtlib/fmt#3798). Thanks @phprus.Added support for ranges with mutable
begin
andend
(format_as
fails when called with certainstd::views
fmtlib/fmt#3752, Fix formatting of ranges with lvalue-qualified, non-const begin() and end() fmtlib/fmt#3800, Fix format_as for non-const begin/end views fmtlib/fmt#3955). Thanks @tcbrindle and @Arghnews.Added support for move-only iterators to
fmt::join
(fmt::join doesn't handle move-only iterators fmtlib/fmt#3802, Fix fmt::join for views with input iterators fmtlib/fmt#3946). Thanks @Arghnews.Moved range and iterator overloads of
fmt::join
tofmt/ranges.h
, next to other overloads.Fixed handling of types with
begin
returningvoid
such as Eigen matrices (fmt/ranges.h incompatible with Eigen 3.4 fmtlib/fmt#3839, Check range_begin is dereferenceable fmtlib/fmt#3964). Thanks @Arghnews.Added an
fmt::formattable
concept (Added formattable concept fmtlib/fmt#3974). Thanks @matt77hias.Added support for
__float128
(Add support for__float128
orstd::float128_t
fmtlib/fmt#3494).Fixed rounding issues when formatting
long double
with fixed precision (Erroneous fixed-precision formatting forlong double
fmtlib/fmt#3539).Made
fmt::isnan
not trigger floating-point exception for NaN values (fmt::isnan
triggers floating-point exception for NaN values fmtlib/fmt#3948, Fixisnan
so it doesn't cause FP errors fmtlib/fmt#3951). Thanks @alexdewar.Removed dependency on
<memory>
forstd::allocator_traits
when possible (Use std::allocator_traits fmtlib/fmt#3804). Thanks @phprus.Enabled compile-time checks in formatting functions that take text colors and styles.
Deprecated wide stream overloads of
fmt::print
that take text styles.Made format string compilation work with clang 12 and later despite only partial non-type template parameter support (Failed to detect trunk clang to support pre-compiled format fmtlib/fmt#4000, Also allow compiled format for clang >= 12 fmtlib/fmt#4001). Thanks @yujincheng08.
Made
fmt::iterator_buffer
's move constructornoexcept
(Markiterator_buffer
move constructors asnoexcept
. fmtlib/fmt#3808). Thanks @waywardmonkeys.Started enforcing that
formatter::format
is const for compatibility withstd::format
(LWG 3636 fmtlib/fmt#3447).Added
fmt::basic_format_arg::visit
and deprecatedfmt::visit_format_arg
.Made
fmt::basic_string_view
not constructible fromnullptr
for consistency withstd::string_view
in C++23 (C++23 compatibility: basic_string_view cannot be constructed from nullptr fmtlib/fmt#3846). Thanks @dalle.Fixed
fmt::group_digits
for negative integers (group_digits
does not work with negative integers fmtlib/fmt#3891, Fix group_digits for negative integers fmtlib/fmt#3901). Thanks @phprus.Fixed handling of negative ids in
fmt::basic_format_args::get
(Fix CodeQL alert fmtlib/fmt#3945). Thanks @marlenecota.Improved named argument validation (The vformat & vprint functions produce incorrect output when mixing named and positional arguments. fmtlib/fmt#3817).
Disabled copy construction/assignment for
fmt::format_arg_store
and fixed moved construction (Fix UB in format_arg_store implementation. fmtlib/fmt#3833). Thanks @ivafanas.Worked around a locale issue in RHEL/devtoolset (chrono locale format code has some bug when using RHEL gcc on CentOS 7.6 to compile fmtlib/fmt#3858, Fix chrono locale format bug for RHEL gcc fmtlib/fmt#3859). Thanks @g199209.
Added RTTI detection for MSVC (Don't always enable typeid usage under MSVC fmtlib/fmt#3821, Update checks for dynamic_cast usage when compiled with no rtti fmtlib/fmt#3963). Thanks @edo9300.
Migrated the documentation from Sphinx to MkDocs.
Improved documentation and README (Documentation for
println
functions is missing fmtlib/fmt#3775, Update README.md fmtlib/fmt#3784, Unexpected behaviour of a format string with alignment and zero fmtlib/fmt#3788, Update documentation fmtlib/fmt#3789, Update fmt/std.h section fmtlib/fmt#3793, Documentation: API example for user-defined formatter doesn't compile fmtlib/fmt#3818, Fix custom formatter example fmtlib/fmt#3820, doc: fix the chrono %C example value fmtlib/fmt#3822, Fix some typos. fmtlib/fmt#3843, Fix relative path for cmake in usage doc fmtlib/fmt#3890, Custom formatter example from the documentation fails to compile fmtlib/fmt#3894, Fix invalid fmt::formatter<>::format return type fmtlib/fmt#3895, Range formatting documentation fmtlib/fmt#3905, Question: what's the difference between string-like formatters and where are they defined? fmtlib/fmt#3942, README.md: update to remove "not yet release" remarks on clang-tidy fmtlib/fmt#4008). Thanks @zencatalyst, WolleTD, @tupaschoal, @Dobiasd, @frank-weinberg, @bbolli, @phprus, @waywardmonkeys, @js324 and @tchaikov.Improved CI and tests ([qtest-parallel testing] C++ exception with description "cannot open file test-file: No such file or directory" thrown in the test body. fmtlib/fmt#3878, Update os-test.cc fmtlib/fmt#3883, Unstable test
format_test.line_buffering
fmtlib/fmt#3897, Reintroduce GCC-11 C++20 into CI fmtlib/fmt#3979, ci: Remove macos-11 runners, add macos-14 fmtlib/fmt#3980, github: update lint.yml to post details on formatting issue fmtlib/fmt#3988, Fix build docs on forks fmtlib/fmt#4010, Update msys2/setup-msys2 to v2.23.0 fmtlib/fmt#4012, Change actions/github-script from e69ef54 -> 60a0d83 fmtlib/fmt#4038). Thanks @vgorrX, @waywardmonkeys, @tchaikov and @phprus.Fixed buffer overflow when using format string compilation with debug format and
std::back_insert_iterator
(Incorrect output and segfault withstd::optional<std::string>
andFMT_COMPILE
fmtlib/fmt#3795, Fix buffer overflow if output iterator is std::back_insert_iterator and value is escaped (debug format) fmtlib/fmt#3797). Thanks @phprus.Improved Bazel support (Extend Bazel build support to bzlmod fmtlib/fmt#3792, Bazel support: Switch to globbing to collect header files fmtlib/fmt#3801, Bazel support: Add utf-8 to Windows build fmtlib/fmt#3962, Bazel support: Add missing platform dependency fmtlib/fmt#3965). Thanks @Vertexwahn.
Improved/fixed the CMake config (fmt.cc includes os.cc regardless of the FMT_OS option. fmtlib/fmt#3777, Fix FMT_OS definition fmtlib/fmt#3783, core.h does not exist. fmtlib/fmt#3847, Make CMake version message less confusing fmtlib/fmt#3907). Thanks @phprus and @xTachyon.
Fixed various warnings and compilation issues (Specializing std::pair formatter leads to compile failures fmtlib/fmt#3685, Different visibility warning fmtlib/fmt#3769, Missing formatter leads to compiler crash for clang 15 or below fmtlib/fmt#3796, GCC9 issue: static_assert(std::is_same<uint64_or_128_t<UInt>, UInt>::value, ""); fmtlib/fmt#3803, Fix conversion warning in filesystem::path formatter fmtlib/fmt#3806, Fix MSVC warning: "The contents of <bit> are available only with C++20 or later." fmtlib/fmt#3807,
nested_formatter
compilation errors fmtlib/fmt#3809, Workaround for gcc 6 fmtlib/fmt#3810, g++-14 warning on self-comparison fmtlib/fmt#3830, Really fix MSVC warning about <bit> only being available in C++20. fmtlib/fmt#3832, FMT_STATIC_THOUSANDS_SEPARATOR broken in 10.0.0 fmtlib/fmt#3835, Fix typo in typename.containter_type
->container_type
. fmtlib/fmt#3844, fmt/std.h happy with c++20, unhappy with c++23 fmtlib/fmt#3854, std.h c++23 build fix fmtlib/fmt#3856, Fix warning C4365 emitted from printf.h fmtlib/fmt#3865, Fix warning C4702 emitted from format.h (MSVC) fmtlib/fmt#3866, Guard against usage of _isatty when header was not included fmtlib/fmt#3880, Does not build on OpenBSD fmtlib/fmt#3881, 'fmt::detail::string_scan_buffer' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] fmtlib/fmt#3884,xchar.h
wide strings are broken in VS 2022 preview 17.10 fmtlib/fmt#3898, Fix make_format_args ambiguous call fmtlib/fmt#3899, Replace std::fill_n with fmt::detail::fill_n fmtlib/fmt#3909, Fix: enableFMT_NORETURN
without exception support too fmtlib/fmt#3917, Resolved warning C4127: conditional expression is constant fmtlib/fmt#3923, Fix mix-up of 'FMT_BEGIN_EXPORT' and 'namespace detail' fmtlib/fmt#3924, fmt::format_to + FMT_STRING with wide characters fails to compile fmtlib/fmt#3925, Resolved warning C4996: 'fileno': The POSIX name for this item is dep… fmtlib/fmt#3930, Fix format_to + FMT_STRING for wide character type fmtlib/fmt#3931, Fix warnings from MSVC fmtlib/fmt#3933, FMT_USE_NONTYPE_TEMPLATE_ARGS detection is wrong on trunk fmtlib/fmt#3935, Fix FMT_USE_NONTYPE_TEMPLATE_ARGS define back fmtlib/fmt#3937, Resolved warning C4127: conditional expression is constant fmtlib/fmt#3967, Fix regression in #3710 fmtlib/fmt#3968, MSVC 17.10.0 + modules cannot find definition fmtlib/fmt#3972, is_convertible_v -> is_convertible::value fmtlib/fmt#3983, Ability to force use of fallback_file fmtlib/fmt#3992, Added generator expression to /utf-8 compile option fmtlib/fmt#3995, Add FMT_FORCE_FALLBACK_FILE to force the use of fallback_file fmtlib/fmt#4009, Suppress a bogus warning in MSVC fmtlib/fmt#4023). Thanks @hmbj, @phprus, @res2k, @Baardi, @matt77hias, @waywardmonkeys, @hmbj, @yakra, @prlw1, @Arghnews, @mtillmann0, @ShifftC, @eepp, @jimmy-park and @ChristianGebhardt.