|
Regina 7.4 Calculation Engine
|
Miscellaneous utility classes for analysing the built-in integer types at compile time. More...
#include "regina-core.h"#include "regina-config.h"#include <cstdint>#include <limits>#include <type_traits>Classes | |
| struct | regina::IsReginaInteger< T > |
| Determines if the type T is one of Regina's own integer types (either arbitrary precision or fixed size). More... | |
| struct | regina::IsReginaArbitraryPrecisionInteger< T > |
| Determines if the type T is one of Regina's arbitrary precision integer types. More... | |
| struct | regina::IntOfSize< bytes > |
| Gives access to native integer types that hold exactly k bytes, where k may be any compile-time constant. More... | |
| struct | regina::IntOfMinSize< bytes > |
| Gives access to native integer types that hold at least k bytes, where k may be any compile-time constant. More... | |
Namespaces | |
| namespace | regina |
| Contains the entire Regina calculation engine. | |
Macros | |
| #define | ENABLE_MEMBER_FOR_REGINA_INTEGER(T, returnType) |
| Conditionally enables a member function for a template class only when the type T is one of Regina's own integer classes. | |
| #define | INT128_AVAILABLE |
| Defined if and only if native 128-bit arithmetic is available on this platform. | |
Typedefs | |
| template<int bits> | |
| using | regina::IntOfMinBits = IntOfMinSize<(bits + 7) / 8> |
| Gives access to native integer types that hold at least k bits, where k may be any compile-time constant. | |
Functions | |
| template<typename IntType > | |
| constexpr int | regina::bitsRequired (IntType n) |
| Returns the number of bits required to store integers in the range 0,...,n-1. | |
| template<typename IntType > | |
| constexpr IntType | regina::nextPowerOfTwo (IntType n) |
| Returns the smallest integer power of two that is greater than or equal to the given argument n. | |
Variables | |
| template<typename T > | |
| constexpr bool | regina::is_cpp_integer_v = std::is_integral_v<T> |
| A compile-time boolean constant that indicates whether the type T is a native C++ integer type, allowing for 128-bit integers also. | |
| template<typename T > | |
| constexpr bool | regina::is_unsigned_cpp_integer_v |
| A compile-time boolean constant that indicates whether the type T is an unsigned native C++ integer type, allowing for 128-bit integers also. | |
| template<typename IntType , IntType coeff> | |
| constexpr IntType | regina::maxSafeFactor |
| The largest integer of the given type that can be multiplied by coeff without overflowing. | |
| template<typename IntType , IntType coeff> | |
| constexpr IntType | regina::minSafeFactor |
| The largest integer of the given type that can be multiplied by coeff without overflowing. | |
Miscellaneous utility classes for analysing the built-in integer types at compile time.
| #define INT128_AVAILABLE |
Defined if and only if native 128-bit arithmetic is available on this platform.
If this macro is defined, then you can access native signed and unsigned 128-bit integers through the types IntOfSize<16>::type and IntOfSize<16>::utype respectively.
If this macro is not defined, then the types IntOfSize<16>::type and IntOfSize<16>::utype will both be void.