1#ifndef _GLUCAT_GLOBAL_H
2#define _GLUCAT_GLOBAL_H
48 #define _GLUCAT_CTAssert(expr, msg) \
49 namespace { struct msg { glucat::CTAssertion<(expr)> ERROR_##msg; }; }
53 template <
typename LHS_T,
typename RHS_T >
59 template <
typename T >
68 template<
bool truth_value >
88 #if (ULONG_MAX == (4294967295UL))
89 #define _GLUCAT_BITS_PER_ULONG 32
90 #elif (ULONG_MAX == (18446744073709551615UL))
91 #define _GLUCAT_BITS_PER_ULONG 64
92 #elif defined(__WORDSIZE)
93 #define _GLUCAT_BITS_PER_ULONG __WORDSIZE
97 _GLUCAT_CTAssert(std::numeric_limits<unsigned char>::radix == 2, CannotDetermineBitsPerChar)
100 const index_t BITS_PER_CHAR = std::numeric_limits<unsigned char>::digits;
114 template<
typename LHS_T,
typename RHS_T >
118 {
return lhs > 0? lhs % rhs : (-lhs) % rhs == 0 ? 0 : rhs - (-lhs) % rhs; }
#define _GLUCAT_CTAssert(expr, msg)
auto pos_mod(LHS_T lhs, RHS_T rhs) -> LHS_T
Modulo function which works reliably for lhs < 0.
const double MS_PER_S
Timing constant: deprecated here - moved to test/timing.h.
unsigned long set_value_t
Size of set_value_t should be enough to contain index_set<LO,HI>
int index_t
Size of index_t should be enough to represent LO, HI.
const index_t BITS_PER_SET_VALUE
Number of bits in set_value_t.
const index_t DEFAULT_HI
Default highest index in an index set.