From fddb00e73dc2d1cda223ab9a3a24bbe08b784563 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 26 Feb 2026 14:39:02 -0500 Subject: [PATCH 1/2] Improve the overview --- doc/modules/ROOT/pages/overview.adoc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/modules/ROOT/pages/overview.adoc b/doc/modules/ROOT/pages/overview.adoc index 236a54d4..01fb1a36 100644 --- a/doc/modules/ROOT/pages/overview.adoc +++ b/doc/modules/ROOT/pages/overview.adoc @@ -15,16 +15,22 @@ Matt Borland Boost.Int128 is a portable implementation of a signed, and an unsigned 128-bit integer and related functionality (i.e. ``, ``, etc). Importantly, on all platforms, the `sizeof` the types provided in this library are exactly 128-bits. -The library is header-only, has no dependencies, and requires only C++14. +The library is header-only, has no dependencies, and requires only pass:[C++14]. +When using pass:[C++20] or newer, the library can be consumed as a module `import boost.int128`. == Motivation -128-bit integers are remarkably useful in a number of domains, but portability is often an issue. -An example is a 64-bit machine running Linux (say Ubuntu 24.04) has `__int128`, but the same exact machine running Windows does not have this type. +128-bit integers are useful across many domains, but pass:[C++] provides no portable way to use them. +GCC and Clang offer `__int128` as a non-standard extension on 64-bit targets, but it lacks `std::numeric_limits` specializations, `` support, and is absent entirely on MSVC. +Multiprecision libraries can fill the gap, but typically at the cost of a larger `sizeof` and additional overhead. +Boost.Int128 solves this by providing types that are exactly 128-bits on every platform. +Operation implementations rely on compiler intrinsic where available for native performance, and optimized software implementations elsewhere. == Use Cases -Anywhere 128-bit integers are needed. +* **Networking** — IPv6 addresses are 128 bits wide; a single integer makes masking, comparison, and arithmetic straightforward. +* **Unique identifiers** — UUIDs / GUIDs are 128-bit values commonly used as database keys and distributed system identifiers. +* **Scientific and Financial computing** — Extended-range accumulators, large combinatorial values, and algorithms that need overflow-free 64×64 multiplication. == Supported Compilers From 1e9524bca4aac3bfce983526fde2a0388bd1dddb Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 26 Feb 2026 14:39:53 -0500 Subject: [PATCH 2/2] Small update to README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d55e7bae..c57a2c5f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ int128 is under active development and is not an official boost library. This library is header only. It contains no other dependencies. Simply `#include` it and use it. +With C++20 and greater you can instead `import boost.int128`. ## CMake @@ -64,7 +65,7 @@ struct int128_t; These types operate like built-in integer types. They have their own implementations of the Standard-Library functions -(e.g. like those found in ``, ``, `` etc.). +(e.g., like those found in ``, ``, `` etc.). The entire library can be conveniently included with `#include `