8#pragma METAL internals : enable
17template <
typename T, T v>
19 static constexpr constant T
value = v;
23 METAL_FUNC
constexpr operator value_type() const noexcept {
40template <
class T, T v>
54#define integral_const_binop(__op__, __operator__) \
55 template <typename T, T tv, typename U, U uv> \
56 METAL_FUNC constexpr auto __operator__( \
57 integral_constant<T, tv>, integral_constant<U, uv>) { \
58 constexpr auto res = tv __op__ uv; \
59 return integral_constant<decltype(res), res>{}; \
77#undef integral_const_binop
84METAL_FUNC
constexpr T
sum(T x) {
88template <
typename T,
typename... Us>
89METAL_FUNC
constexpr auto sum(T x, Us... us) {
90 return x +
sum(us...);
96#pragma METAL internals : disable
#define integral_const_binop(__op__, __operator__)
Definition integral_constant.h:54
bool_constant< true > true_type
Definition integral_constant.h:34
constexpr constant bool is_integral_v
Definition integral_constant.h:45
bool_constant< false > false_type
Definition integral_constant.h:35
METAL_FUNC constexpr T sum(T x)
Definition integral_constant.h:84
integral_constant< bool, B > bool_constant
Definition integral_constant.h:33
integral_constant< int, val > Int
Definition integral_constant.h:48
Definition integral_constant.h:18
T value_type
Definition integral_constant.h:20
static constexpr constant bool value
Definition integral_constant.h:19
integral_constant type
Definition integral_constant.h:21
Definition integral_constant.h:38