<xstd/ints/cstdint/int128.hpp>¶
XSTD_HAS_INT128¶
#define XSTD_HAS_INT128 see below
Whether the 128-bit pair is available. Defined as 1 where _MSC_VER is defined or, failing that, where
__SIZEOF_INT128__ is; not defined otherwise.
Notes¶
Where it is not defined, as with GCC and Clang on 32-bit x86 and ARM, int128, uint128 and their two associations
are not declared, and including the header is not an error.
See also¶
| Entity | Relation |
|---|---|
int128, uint128 |
declared where it is defined |
XSTD_HAS_BIT_INT |
the same question asked of the bit-precise types |
xstd::int128, xstd::uint128¶
// (1)
using int128 = see below;
// (2)
using uint128 = see below;
// (3)
template<> struct make_unsigned<int128>;
// (4)
template<> struct make_signed<uint128>;
The 128-bit integer pair: where _MSC_VER is defined, std::_Signed128 and std::_Unsigned128 from the Microsoft
STL's <__msvc_int128.hpp>; otherwise __int128 and unsigned __int128.
- The signed half.
- The unsigned half.
make_unsigned<int128>::typeisuint128.make_signed<uint128>::typeisint128.
Remarks¶
- The aliases and the two associations are declared in one header, so a translation unit that names either type has both specializations.
- GCC's
-Wpedanticdiagnostic on__int128is suppressed around the two alias declarations.
Notes¶
- Each occupies 16 bytes, and
std::numeric_limitsgivesint128127 digits anduint128128. int128is signed anduint128unsigned, bystd::numeric_limits, byis_signed_vandis_unsigned_vunder every cv-qualification, and bysigned_integerandunsigned_integer.- The width carries values:
int128{-1} < int128{0}, anduint128{1} << 127Uis nonzero, as constant expressions. - Through the cv-qualified specializations of either trait,
const,volatileandconst volatilecarry over. - Both model
nothrow_const_operators.
See also¶
| Entity | Relation |
|---|---|
make_signed, make_unsigned |
the traits (3) and (4) specialize |
signed_integer, unsigned_integer |
what (1) and (2) model |
boost::int128, absl::int128 |
the other 128-bit pairs, paired by the ext headers |
bit_int, bit_uint |
the bit-precise types |