C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::big_int

From: Jan Schultke <janschultke_at_[hidden]>
Date: Fri, 3 Apr 2026 07:46:54 +0200
Another thought I had when it comes to std::big_int procedurally is that we
may want to walk before we run.

Tiago's P3161R4 has been in the pipeline for a long time, and adds
prerequisite functions such as std::mul_wide. Widening multiplication is
necessary to implement multi-precision multiplication in std::big_int.
Similarly, Daniel Towner provides funnel-shifting in P4010R0, which is
necessary to implement multi-precision bit-shifting.

I think the burden on both the reference and the standard library
implementation would be lower if we had the prerequisite tools before we
had the big container that uses those tools. If the reference
implementation used std::mul_wide, this could be copied verbatim into a
standard library implementation, rather than having to rewrite all the
conditional compilation and intrinsics and whatnot. At least that's how I'm
imagining it.

Received on 2026-04-03 05:47:08