|
libhatchet
|
Go to the source code of this file.
Classes | |
| class | hxnil_t |
| struct | hxtrue_t |
| struct | hxfalse_t |
Concepts | |
| concept | hxconvertible_to |
| concept | hxsame_as |
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 | |
| HX_C_BEGIN_ void | hxfloat_view (const float *address_, size_t size_) |
| void | hxhex_view (const void *address_, size_t bytes_, bool pretty_) |
| template<typename T, hxsize_t N_> | |
| HX_C_END_ HX_NS_BEGIN_ constexpr hxsize_t | hxsize (T(&)[N_]) |
| template<typename T> | |
| T && | hxdeclval (void) noexcept |
| template<typename T, typename U_> | |
| constexpr bool | hxbinds_directly (void) |
| template<typename T> | |
| constexpr bool | hxis_array (void) |
| template<typename T> | |
| constexpr bool | hxis_const (void) |
| template<typename T> | |
| constexpr bool | hxis_floating_point (void) |
| template<typename T> | |
| constexpr bool | hxis_integral (void) |
| template<typename T> | |
| constexpr bool | hxis_lvalue_reference (void) |
| template<typename T> | |
| constexpr bool | hxis_pointer (void) |
| template<typename T> | |
| constexpr bool | hxis_reference (void) |
| template<typename T> | |
| constexpr bool | hxis_rvalue_reference (void) |
| template<typename A_, typename B_> | |
| constexpr bool | hxis_same (void) |
| template<typename T> | |
| constexpr bool | hxis_void (void) |
| 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 like_t_, typename value_t_> | |
| constexpr hxforward_like_t_< like_t_, value_t_ > | hxforward_like (value_t_ &value_) |
| 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 hxnil_t | hxnil {} |
A few utility functions and most standard C++ meta programming functions.
| using hxremove_cv_t = typename hxremove_cv_<T>::type |
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 |
hxbinds_directly<T, U> - Returns true when an lvalue of type U binds to T& without creating a temporary.
|
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.
| HX_C_BEGIN_ void hxfloat_view | ( | const float * | address_, |
| size_t | size_ ) |
hxfloat_view - 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&&.
|
constexpr |
hxforward_like<T> - Returns value with the constness and value category of T.
T must be explicitly specified.
| void hxhex_view | ( | const void * | address_, |
| size_t | bytes_, | ||
| bool | pretty_ ) |
hxhex_view - Prints an array of bytes formatted in hexadecimal.
Additional information provided when pretty is non-zero.
|
constexpr |
hxis_array<T> - Implements std::is_array.
|
constexpr |
hxis_const<T> - Implements std::is_const.
|
constexpr |
hxis_floating_point<T> - Implements std::is_floating_point.
|
constexpr |
hxis_integral<T> - Implements std::is_integral.
|
constexpr |
hxis_lvalue_reference<T> - Implements std::is_lvalue_reference.
|
constexpr |
hxis_pointer<T> - Implements std::is_pointer.
|
constexpr |
hxis_reference<T> - Implements std::is_reference.
|
constexpr |
hxis_rvalue_reference<T> - Implements std::is_rvalue_reference.
|
constexpr |
hxis_same<A, B> - Implements std::is_same.
|
constexpr |
hxis_void<T> - Implements std::is_void.
|
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 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&&.
|
constexpr |
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.