23#define hilet auto const
29#define hi_forward(x) std::forward<decltype(x)>(x)
38#define hi_return_if_valid(expression) \
40 if constexpr (requires { expression; }) { \
48#define hi_num_va_args_impl( \
49 _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \
50 _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \
51 _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \
52 _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \
53 _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \
54 _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \
56#define hi_num_va_args_(...) hi_num_va_args_impl(__VA_ARGS__)
63#define hi_num_va_args(...) hi_num_va_args_(__VA_ARGS__ __VA_OPT__(,) \
65 59,58,57,56,55,54,53,52,51,50, \
66 49,48,47,46,45,44,43,42,41,40, \
67 39,38,37,36,35,34,33,32,31,30, \
68 29,28,27,26,25,24,23,22,21,20, \
69 19,18,17,16,15,14,13,12,11,10, \
75#define hi_expand1(...) __VA_ARGS__
76#define hi_expand2(...) hi_expand1(hi_expand1(hi_expand1(hi_expand1(__VA_ARGS__))))
77#define hi_expand3(...) hi_expand2(hi_expand2(hi_expand2(hi_expand2(__VA_ARGS__))))
78#define hi_expand4(...) hi_expand3(hi_expand3(hi_expand3(hi_expand3(__VA_ARGS__))))
84#define hi_expand(...) hi_expand4(hi_expand4(hi_expand4(hi_expand4(__VA_ARGS__))))
86#define hi_for_each_again() hi_for_each_helper
87#define hi_for_each_helper(macro, first_arg, ...) macro(first_arg) __VA_OPT__(hi_for_each_again hi_parans(macro, __VA_ARGS__))
94#define hi_for_each(macro, ...) __VA_OPT__(hi_expand(hi_for_each_helper(macro, __VA_ARGS__)))
96#define hi_stringify_(x) #x
97#define hi_stringify(x) hi_stringify_(x)
99#define hi_cat_(a, b) a##b
100#define hi_cat(a, b) hi_cat_(a, b)
102#define hi_return_on_self_assignment(other) \
103 if (&(other) == this) [[unlikely]] \
115#define hi_get_overloaded_macro2(_1, _2, name, ...) name
117#if defined(__clang__)
118#define hi_assume(condition) __builtin_assume(to_bool(condition))
119#define hi_force_inline inline __attribute__((always_inline))
120#define hi_no_inline __attribute__((noinline))
121#define hi_restrict __restrict__
122#define hi_warning_push() _Pragma("warning(push)")
123#define hi_warning_pop() _Pragma("warning(push)")
124#define hi_warning_ignore_msvc(code)
125#define hi_warning_ignore_clang(a) _Pragma(hi_stringify(clang diagnostic ignored a))
127#elif defined(_MSC_BUILD)
128#define hi_assume(condition) __assume(condition)
129#define hi_force_inline __forceinline
130#define hi_no_inline __declspec(noinline)
131#define hi_restrict __restrict
132#define hi_warning_push() _Pragma("warning( push )")
133#define hi_warning_pop() _Pragma("warning( pop )")
134#define hi_msvc_pragma(a) _Pragma(a)
135#define hi_warning_ignore_msvc(code) _Pragma(hi_stringify(warning(disable : code)))
136#define hi_warning_ignore_clang(a)
138#elif defined(__GNUC__)
139#define hi_assume(condition) \
142 std::unreachable(); \
144#define hi_force_inline inline __attribute__((always_inline))
145#define hi_no_inline __attribute__((noinline))
146#define hi_restrict __restrict__
147#define hi_warning_push() _Pragma("warning(push)")
148#define hi_warning_pop() _Pragma("warning(pop)")
149#define hi_msvc_pragma(a)
150#define hi_warning_ignore_clang(a)
151#define msvc_pragma(a)
154#define hi_assume(condition) static_assert(sizeof(condition) == 1)
155#define hi_force_inline inline
158#define hi_warning_push()
159#define hi_warning_pop()
160#define hi_msvc_pragma(a)
161#define hi_warning_ignore_clang(a)
162#define msvc_pragma(a)
173namespace hi {
inline namespace v1 {
179#define ssizeof(x) (static_cast<ssize_t>(sizeof(x)))
181constexpr std::size_t operator"" _uz(
unsigned long long lhs)
noexcept
186constexpr std::size_t operator"" _zu(
unsigned long long lhs)
noexcept
191constexpr std::ptrdiff_t operator"" _z(
unsigned long long lhs)
noexcept
199template<
typename T,
typename U>
203 lhs = std::forward<U>(rhs);
215template<
typename T,
typename U>
218 return lhs.exchange(rhs, std::memory_order::relaxed) != rhs;
244template<
class T,
class U>
245[[nodiscard]]
constexpr auto&& forward_like(U&& x)
noexcept
247 constexpr bool is_adding_const = std::is_const_v<std::remove_reference_t<T>>;
248 if constexpr (std::is_lvalue_reference_v<T&&>) {
249 if constexpr (is_adding_const) {
250 return std::as_const(x);
252 return static_cast<U&
>(x);
255 if constexpr (is_adding_const) {
hi_warning_ignore_msvc(26472)
Definition int_carry.hpp:27
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition utility.hpp:200
Tag used for special functions or constructions to do a override compared to another function of the ...
Definition utility.hpp:223
Tag used in constructors to set the intrinsic value of that object.
Definition utility.hpp:230
A type that can not be constructed, copied, moved or destructed.
Definition utility.hpp:235