On Mon, 6 Oct 2025 at 17:46, John Maddock via Boost <boost@lists.boost.org> wrote:
The second review of the proposed Decimal Number library by Matt Borland and Chris Kormanyos begins today and runs until 15th Oct.
You will find documentation here: https://develop.decimal.cpp.al/decimal/overview.html
And the code repository is here: https://github.com/cppalliance/decimal/
Boost.Decimal is an implementation of IEEE 754 <https://standards.ieee.org/ieee/754/6210/> <https://standards.ieee.org/ieee/754/6210/%3E> and ISO/IEC DTR 24733 <https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2849.pdf> <https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2849.pdf%3E> Decimal Floating Point numbers.
Hi all, This is my re-review of the proposed Boost.Decimal library. Thanks again to Matt for submitting the library, and to John for managing the review. TL;DR: my recommendation is to ACCEPT the library into Boost. No conditions. Most of my concerns from my last review [1] [2] have been addressed, the library has a growing user base, and it's useful. My most pressing concern during the last review was performance [2], and IMO this has been addressed. Most of my concerns regarding API cleanness have also been fixed. Fuzz testing has increased coverage, which is great. I like having fmt support. The way the optional dependency is handled in the header seems a bit esoteric though - the fmt_format.hpp header has the following: #if __has_include(<fmt/format.h>) && __has_include(<fmt/base.h>) And then gets included in <boost/decimal.hpp>. By convention, headers with optional dependencies don't get included in the convenience header (e.g. see Asio with OpenSSL). As a user, I'd prefer a "can't find include <fmt/format.h>" error than "X function is not defined" when the dependency can't be found for whatever reason. I've refreshed my MySQL DECIMAL compatibility prototype [9] and it's worked correctly. The new library version seems to trigger an ICE under MSVC 14.33 [10], but that CI is running a slightly outdated compiler version. Some points: * BOOST_DECIMAL_REDUCE_TEST_DEPTH, debug_pattern and bit_string are still defined in public headers, when they belong to tests. * The example on literals [3] hasn't updated the using namespace clause (should be boost::decimal::literals rather than boost::decimal). You might find it useful to build and run the examples on CI, and include the code in the docs by using asciidoc tagged regions [4]. * boost::decimal::to_string seems to still be public but not documented. * The docs list an entry for Rounding Mode that looks like a dead link [5]. * I'd try to avoid using the <boost/decimal.hpp> include at all in the examples. We then get complaints on "Boost makes your builds slow". Specially, please try to avoid this recommendation in the tutorial [6]. * The examples section topics are great, but the content seems more like unit tests than examples [7]. I miss text explaining what the example is trying to do, some comments, etc. * The example on charconv uses an assert to check the return value, and this makes me very uncomfortable [8]. I've found real-life projects with people "checking" return values with assert like this (there are developers that haven't heard about NDEBUG, apparently). So I'd be more comfortable with an "if (r_from) { /* handle failure */ }". * There are still places marked by LCOV_EXCL_START/LCOV_EXCL_STOP that correspond to valid code paths. Please try to avoid this. It's okay not having 100% coverage, but marking corner cases as "won't happen" makes the metric less reliable. Affiliation disclosure: I'm currently affiliated with the C++ Alliance, as is Matt Borland. Regards, Ruben. [1] https://lists.boost.org/archives/list/boost@lists.boost.org/message/T63BOOVG... [2] https://lists.boost.org/archives/list/boost@lists.boost.org/message/M247DGXG... [3] https://develop.decimal.cpp.al/decimal/examples.html#examples_literals_const... [4] https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regio... [5] https://develop.decimal.cpp.al/decimal/examples.html#examples_rounding_mode [6] https://develop.decimal.cpp.al/decimal/basics.html#basics_using_the_library [7] https://develop.decimal.cpp.al/decimal/examples.html [8] https://develop.decimal.cpp.al/decimal/examples.html#examples_charconv [9] https://github.com/boostorg/mysql/pull/399 [10] https://drone.cpp.al/boostorg/mysql/1130/51/2