|
libhatchet
|
Go to the source code of this file.
Classes | |
| class | hxnullptr_t |
| struct | hxtrue_t |
| struct | hxfalse_t |
| struct | hxbinds_directly< T, U_ > |
| struct | hxis_array< T > |
| struct | hxis_array< T[size_]> |
| struct | hxis_array< T[]> |
| struct | hxis_const< T > |
| struct | hxis_const< const T > |
| struct | hxis_floating_point< T > |
| struct | hxis_integral< T > |
| struct | hxis_lvalue_reference< T > |
| struct | hxis_lvalue_reference< T & > |
| struct | hxis_pointer< T > |
| struct | hxis_reference< T > |
| struct | hxis_reference< T & > |
| struct | hxis_reference< T && > |
| struct | hxis_rvalue_reference< T > |
| struct | hxis_rvalue_reference< T && > |
| struct | hxis_same< A_, B_ > |
| struct | hxis_same< A_, A_ > |
| struct | hxis_void< T > |
Typedefs | |
| template<typename T> | |
| using | hxremove_cv_t = typename hxremove_cv_<T>::type |
| template<typename T> | |
| using | hxremove_pointer_t = typename hxremove_pointer_<T>::type |
| template<typename T> | |
| using | hxremove_reference_t = typename hxremove_reference_<T>::type |
| template<typename T> | |
| using | hxremove_cvref_t = hxremove_cv_t<hxremove_reference_t<T>> |
| template<typename T> | |
| using | hxrestrict_t = typename hxrestrict_t_<T>::type |
Functions | |
| void | hxfloat_dump (const float *address_, size_t floats_) |
| void | hxhex_dump (const void *address_, size_t bytes_, bool pretty_) |
| template<typename T, hxsize_t N_> | |
| HX_NS_BEGIN_ constexpr hxsize_t | hxsize (T(&)[N_]) |
| template<typename T> | |
| T && | hxdeclval (void) noexcept |
| constexpr bool | hxisgraph (char ch_) |
| constexpr bool | hxisspace (char ch_) |
| int | hxlog2i (uint32_t i_) |
| template<typename T> | |
| constexpr T | hxabs (T x_) |
| template<typename T> | |
| constexpr T | hxclamp (T x_, T minimum_, T maximum_) |
| template<typename T> | |
| constexpr T && | hxforward (hxremove_reference_t< T > &&x_) |
| template<typename T> | |
| constexpr T && | hxforward (hxremove_reference_t< T > &x_) |
| template<typename T> | |
| constexpr T | hxmax (T x_, T y_) |
| template<typename T> | |
| constexpr T | hxmin (T x_, T y_) |
| template<typename T> | |
| constexpr hxremove_reference_t< T > && | hxmove (T &&t_) |
| template<typename T> | |
| constexpr void | hxswap (T &x_, T &y_) |
| template<typename T> | |
| void | hxswap_memcpy (T &x_, T &y_) |
Variables | |
| constexpr hxnullptr_t | hxnullptr {} |
A few utility functions and most standard C++ meta programming functions.
| using hxremove_cv_t = typename hxremove_cv_<T>::type |
Internal.
Implements std::remove_cv. hxremove_cv_t - Removes const and volatile from a type. Implements std::remove_cv_t. This is used to maintain semantic compatibility with the standard.
| using hxremove_cvref_t = hxremove_cv_t<hxremove_reference_t<T>> |
hxremove_cvref_t<T> - Returns T with const, volatile, and references removed.
| using hxremove_pointer_t = typename hxremove_pointer_<T>::type |
hxremove_pointer_t<T> - Returns T with one pointer level removed.
| using hxremove_reference_t = typename hxremove_reference_<T>::type |
hxremove_reference_t<T> - Returns T with references removed.
| using hxrestrict_t = typename hxrestrict_t_<T>::type |
hxrestrict_t - Adds the __restrict keyword to C++ pointers.
(Non-standard.)
|
constexpr |
hxabs - Returns the absolute value of x using a < comparison.
|
constexpr |
hxclamp - Returns x clamped between the minimum and maximum using < comparisons.
|
noexcept |
hxdeclval - Implements std::declval.
Returns a T&& reference for use in unevaluated contexts such as decltype. Must not be called or defined.
| void hxfloat_dump | ( | const float * | address_, |
| size_t | floats_ ) |
hxfloat_dump - Prints an array of floating point values.
|
constexpr |
hxforward - Implements std::forward.
Call as hxforward<T>(x) from inside a templated forwarding function where the parameter was declared T&& and T was deduced. T must be explicitly specified. E.g.,
This is the T&& version of hxforward<T>.
|
constexpr |
hxforward - This is the T& version of hxforward<T>.
It gets invoked when T turns out to be an l-value. This happens when a T& is passed as a T&&.
| void hxhex_dump | ( | const void * | address_, |
| size_t | bytes_, | ||
| bool | pretty_ ) |
hxhex_dump - Prints an array of bytes formatted in hexadecimal.
Additional information provided when pretty is non-zero.
|
constexpr |
hxisgraph - Implements standard isgraph for a locale where all non-ASCII characters are considered graphical or mark making.
This is compatible with scanf-style parsing of UTF-8 string parameters. However, this is not en_US.UTF-8, the default C locale or the POSIX locale.
|
constexpr |
hxisspace - Implements standard isspace for a locale where all non-ASCII characters are considered graphical or mark making.
Returns nonzero for space and \t \n \v \f \r. This is compatible with scanf-style parsing of UTF-8 string parameters. However, this is not en_US.UTF-8. It does match the the default C locale and the POSIX locale.
|
inline |
hxlog2i - Returns log2(n) as an integer which is the power of 2 of the largest bit in n.
WARNING: hxlog2i(0) is UB. The fallback implementation returns -127 for 0 and rounds up for i >= 2^32-128 returning an incorrect result.
|
constexpr |
hxmax - Returns the maximum value of x and y using a < comparison.
|
constexpr |
hxmin - Returns the minimum value of x and y using a < comparison.
|
constexpr |
hxmove - Implements std::move.
Converts either a T& or a T&& to a T&&. Do not specify T explicitly as it will not work as expected. This uses the rules about reference collapsing to handle both T& and T&&.
hxsize - Returns the size of a C array.
Rejects pointer arguments at compile time.
|
constexpr |
hxswap - Exchanges the contents of x and y using a temporary.
If T has T::T(T&&) or T::operator=(T&&) then those will be used.
| void hxswap_memcpy | ( | T & | x_, |
| T & | y_ ) |
hxswap_memcpy - Exchanges the contents of x and y using memcpy and a stack temporary.
This is intended for internal use where T is known to be trivially copyable.
|
inlineconstexpr |
hxnullptr - An instance of a class that will only convert to a null pointer.
Useful when an integer constant arg would be ambiguous or otherwise break template code. hxnullptr is a hxnullptr_t. Use plain hxnull for == and != comparisons.