<xstd/ints/ext/absl/int128.hpp>¶
xstd::make_unsigned<absl::int128>, xstd::make_signed<absl::uint128>¶
// (1)
template<> struct make_unsigned<absl::int128>;
// (2)
template<> struct make_signed<absl::uint128>;
The pairing of Abseil's two 128-bit types, each with the other.
- The member
typeisabsl::uint128. - The member
typeisabsl::int128.
Member types¶
| Type | Definition |
|---|---|
type |
the other half of Abseil's pair |
Remarks¶
Where Abseil has no 128-bit intrinsic, its operator/ and operator% are not constexpr, and neither is a function
that divides one.
Notes¶
- With the integer-class specializations each half is its own counterpart, the round trip is the identity, the cv-qualifiers carry over, and the pair's limits have the range of [iterator.concept.winc]/3.
- With them,
absl::int128modelssigned_integerandabsl::uint128modelsunsigned_integer. - The mistakes that port from built-in code stay compile errors for the signed half:
divwith anintliteral divisor,popcount, andalign_up. - Abseil declares no
noexcept, so the pair models neithernothrow_const_operatorsnor, forabsl::uint128,nothrow_alignable, and the integer functions over it are notnoexcept. - The pair hashes as every other 128-bit type does.
- The header and its umbrella each compile on their own wherever Abseil is found.
See also¶
| Entity | Relation |
|---|---|
make_signed, make_unsigned |
the traits it specializes |
signed_integer, unsigned_integer |
what the pair models with it |
nothrow_const_operators |
what the pair does not model |
boost::int128 |
the same for Boost's pair |