Path to this page:
Subject: CVS commit: pkgsrc/textproc/fmtlib
From: Thomas Klausner
Date: 2023-05-16 23:16:08
Message id: 20230516211608.CDD10FA87@cvs.NetBSD.org
Log Message:
fmtlib: update to 10.0.0.
10.0.0 - 2023-05-09
-------------------
* Replaced Grisu with a new floating-point formatting algorithm for given
precision
The new algorithm is based on Dragonbox already used for the
shortest representation and gives substantial performance improvement:
* Replaced ``snprintf``-based hex float formatter with an internal
implementation
This removes the last usage of ``s(n)printf`` in {fmt}.
* Fixed alignment of floating-point numbers with localization
* Improved C++20 module support
Switched to the `modules CMake library <https://github.com/vitaut/modules>`_
which allows building {fmt} as a C++20 module with clang::
CXX=clang++ cmake -DFMT_MODULE=ON .
make
* Made ``format_as`` work with any user-defined type and not just enums.
For example (`godbolt <https://godbolt.org/z/b7rqhq5Kh>`__):
.. code:: c++
#include <fmt/format.h>
struct floaty_mc_floatface {
double value;
};
auto format_as(floaty_mc_floatface f) { return f.value; }
int main() {
fmt::print("{:8}\n", floaty_mc_floatface{0.42}); // prints \
" 0.42"
}
* Removed deprecated implicit conversions for enums and conversions to primitive
types for compatibility with ``std::format`` and to prevent potential ODR
violations. Use ``format_as`` instead.
* Added support for fill, align and width to the time point formatter
* Implemented formatting of subseconds
* Added precision support to ``%S``
* Added support for ``std::utc_time``
* Switched formatting of ``std::chrono::system_clock`` from local time to UTC
for compatibility with the standard
* Added support for ``%Ez`` and ``%Oz`` to chrono formatters.
* Improved validation of format specifiers for ``std::chrono::duration``
* Fixed formatting of time points before the epoch
* Experimental: implemented glibc extension for padding seconds, minutes and
hours
* Added a formatter for ``std::exception``
* Moved ``std::error_code`` formatter from ``fmt/os.h`` to ``fmt/std.h``.
* Added formatters for standard container adapters: ``std::priority_queue``,
``std::queue`` and ``std::stack``
* Added a formatter for ``std::optional`` to ``fmt/std.h``.
* Fixed formatting of valueless by exception variants
* Made ``fmt::ptr`` accept ``unique_ptr`` with a custom deleter
* Fixed formatting of noncopyable ranges and nested ranges of chars
* Fixed issues with formatting of paths and ranges of paths
* Improved handling of invalid Unicode in paths.
* Enabled compile-time checks on Apple clang 14 and later
* Improved compile-time checks of named arguments
* Fixed formatting when both alignment and ``0`` are given
* Improved Unicode support in the experimental file API on Windows
* Unified UTF transcoding
* Added support for UTF-8 digit separators via an experimental locale facet
* Added an overload of ``formatted_size`` that takes a locale
* Removed the deprecated ``FMT_DEPRECATED_OSTREAM``.
* Fixed a UB when using a null ``std::string_view`` with ``fmt::to_string``
or format string compilation
* Added ``starts_with`` to the fallback ``string_view`` implementation
* Added ``fmt::basic_format_string::get()`` for compatibility with
``basic_format_string``
* Added ``println`` for compatibility with C++23
* Improved documentation
* Improved build configuration and tests
* Fixed a regression in handling empty format specifiers after a colon (``{:}``)
* Worked around a broken implementation of ``std::is_constant_evaluated`` in
some versions of libstdc++ on clang
* Fixed formatting of volatile variables
* Fixed various warnings and compilation issues
Files: