Hey folks,

During the Croydon meeting, I have talked to a few other committee members, and there seems to be a bit of enthusiasm for a "big int" type. That is, an infinite-precision integer, as compared to _BitInt(N), which has fixed width and does not "type erase" the width.

I think the motivation is obvious at this point. Unbounded integers are a feature of standard libraries in many languages, are incredibly useful, and are a vocabulary type. Specifically in C++, it may also be possible to make std::big_int an intrinsic for the compiler's infinite-precision integer type (such as llvm::APInt) during constant evaluation. This has the potential of making a standard std::big_int dramatically faster than any constexpr library implementation could ever be.

I believe that there are a few key design decisions (most also made in Boost.Multiprecision) which are desirable to standardize:

One design aspect I'm not so sure about is whether std::big_int would be allocator-aware and whether the "limb type" should be configurable. If neither of these is true, it could be a non-templated class, which is attractive.

It's worth noting that I walk on a sea of corpses. N1692, N1744, and N4038 tried to add a big integer type previously, but all died in the process. N4038 got the furthest, but died in SG6. In any case, if we want to have this in C++29, we need to act soon. This proposal is a massive effort, and I could not do it myself I think given how many papers I already have, so if anyone else is interested in supporting the effort, please reach out.


Jan