Skip to content

<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.

  1. The member type is absl::uint128.
  2. The member type is absl::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::int128 models signed_integer and absl::uint128 models unsigned_integer.
  • The mistakes that port from built-in code stay compile errors for the signed half: div with an int literal divisor, popcount, and align_up.
  • Abseil declares no noexcept, so the pair models neither nothrow_const_operators nor, for absl::uint128, nothrow_alignable, and the integer functions over it are not noexcept.
  • 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