17#if defined(__cpp_lib_format)
21#ifndef SPARROW_USE_LARGE_INT_PLACEHOLDERS
24# if defined(__clang__) || defined(__GNUC__)
25# pragma GCC diagnostic push
26# pragma GCC diagnostic ignored "-Wold-style-cast"
27# pragma GCC diagnostic ignored "-Wsign-conversion"
28# pragma GCC diagnostic ignored "-Wshadow"
29# pragma GCC diagnostic ignored "-Wsign-conversion"
31# include <sparrow/details/3rdparty/large_integers/int128_t.hpp>
32# include <sparrow/details/3rdparty/large_integers/int256_t.hpp>
34# if defined(__clang__) || defined(__GNUC__)
35# pragma GCC diagnostic pop
44#ifdef SPARROW_USE_LARGE_INT_PLACEHOLDERS
51 std::uint64_t words[2];
55 return words[0] == other.words[0] && words[1] == other.words[1];
58 bool operator!=(
const int128_t& other)
const
60 return !(*
this == other);
67 std::uint64_t words[4];
71 return words[0] == other.words[0] && words[1] == other.words[1] && words[2] == other.words[2]
72 && words[3] == other.words[3];
75 bool operator!=(
const int256_t& other)
const
77 return !(*
this == other);
81 constexpr bool is_int_placeholder_v = std::is_same_v<T, int128_t> || std::is_same_v<T, int256_t>;
92 requires(std::is_same_v<T, int128_t> || std::is_same_v<T, int256_t>)
93 inline std::ostream&
operator<<(std::ostream& stream, T n)
104 str.push_back(
static_cast<char>(
'0' + std::int8_t(n % 10)));
113 stream << std::string(str.rbegin(), str.rend());
120#if defined(__cpp_lib_format)
122# if defined(SPARROW_USE_LARGE_INT_PLACEHOLDERS)
127 constexpr auto parse(std::format_parse_context& ctx)
134 return std::format_to(ctx.out(),
"{}",
"Integer int128_t TODO");
143 constexpr auto parse(std::format_parse_context& ctx)
150 return std::format_to(ctx.out(),
"{}",
"Integer int256_t TODO");
primesum::int128_t int128_t
SPARROW_API bool operator==(const array &lhs, const array &rhs)
Compares the content of two arrays.
constexpr bool is_int_placeholder_v
constexpr bool large_int_placeholders
primesum::int256_t int256_t