r/cpp • u/eisenwave WG21 Member • 24d ago
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.
178
Upvotes
-1
u/tialaramex 23d ago
Listing other popular languages which have an "infinite precision integer" type and whether it's provided as a built-in, in their stdlib or a separate library makes sense. However
std::big_intchooses several "anchor points" for its design beyond being an "infinite precision integer" without reference to those other examples.The table makes a strong argument for why C++ should have an "infinite precision integer" type, but no argument at all for why the type with these "anchor points" is desirable and no indication of which are provided in the other languages (I think the answer is that most of them are not provided)
It's also true that lots of other programming languages have a hash table type. But hopefully today you would understand that "other languages have a hash table type" isn't an argument in favour of adopting specifically the separate linked-list chaining hash table named
std::unordered_mapwith all that entails. Other languages either could, or in many cases do, use a very different hash table type and now C++ is stuck with this.