r/cpp • u/eisenwave WG21 Member • Aug 18 '26
P4444: std::big_int
https://isocpp.org/files/papers/D4444R0.htmlHey folks! Matt Borland, Christopher Kormanyos, and I are working on bringing infinite-precision integers to C++29. We now have a D4444R0 draft of a paper that should be in the next mailing.
We could really use some feedback so that the published R0 is as polished as possible. Any thoughts on the paper and on the reference implementation are greatly appreciated.
It would also be very helpful if you tested out whether our big_int implementation works for you. We're in need of some real deployment experience. If you're currently using Boost.Multiprecision, the library should be a drop-in replacement for cpp_int for the most part.
View all comments
Show parent comment
2
u/eisenwave WG21 Member Aug 18 '26
It would be nice if we could solve that problem generally for
std::vectorandstd::stringtoo, for sure. Singling outstd::big_int(and only the inplace value case) is clunky.Not doing that seems to be the worst outcome though because the end result is that
std::big_intwould only sometimes be usable as aconstexprvariable, and you might get inconsistent behavior between standard libraries. Ifstd::big_intcannot always be put into aconstexprvariable, there should at least be consistent behavior between implementations (for equalinplace_capacityat least).You actually have that behavior right now with
constexpr std::stringvariables: they sometimes work, and sometimes don't, and it's kinda arbitrary from the user's perspective.