29#ifndef _GLIBCXX_STDCKDINT_H
30#define _GLIBCXX_STDCKDINT_H
32#if __cplusplus > 202302L
36#define __STDC_VERSION_STDCKDINT_H__ 202311L
38#ifndef _GLIBCXX_DOXYGEN
40namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
46 template<
typename _Tp>
47 concept __cv_unqual_signed_or_unsigned_integer_type
48 = std::same_as<_Tp, std::remove_cv_t<_Tp>>
49 && std::__is_standard_integer<_Tp>::value;
70template<
typename _Tp1,
typename _Tp2,
typename _Tp3>
72 ckd_add(_Tp1* __result, _Tp2 __a, _Tp3 __b)
74 using __gnu_cxx::__detail::__cv_unqual_signed_or_unsigned_integer_type;
75 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp1>);
76 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp2>);
77 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp3>);
78 return __builtin_add_overflow(__a, __b, __result);
81template<
typename _Tp1,
typename _Tp2,
typename _Tp3>
83 ckd_sub(_Tp1* __result, _Tp2 __a, _Tp3 __b)
85 using __gnu_cxx::__detail::__cv_unqual_signed_or_unsigned_integer_type;
86 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp1>);
87 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp2>);
88 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp3>);
89 return __builtin_sub_overflow(__a, __b, __result);
92template<
typename _Tp1,
typename _Tp2,
typename _Tp3>
94 ckd_mul(_Tp1* __result, _Tp2 __a, _Tp3 __b)
96 using __gnu_cxx::__detail::__cv_unqual_signed_or_unsigned_integer_type;
97 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp1>);
98 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp2>);
99 static_assert(__cv_unqual_signed_or_unsigned_integer_type<_Tp3>);
100 return __builtin_mul_overflow(__a, __b, __result);
103#ifndef _GLIBCXX_DOXYGEN
106using __gnu_cxx::ckd_add;
107using __gnu_cxx::ckd_sub;
108using __gnu_cxx::ckd_mul;
GNU extensions for public use.
Implementation details not part of the namespace __gnu_cxx interface.