|
HikoGUI
A low latency retained GUI
|
Utilities used by the HikoGUI library itself. More...
#include <cstddef>#include <string>#include <chrono>Go to the source code of this file.
Namespaces | |
| namespace | hi |
| The HikoGUI namespace. | |
| namespace | hi::v1 |
| The HikoGUI API version 1. | |
Macros | |
| #define | hilet auto const |
| Invariant should be the default for variables. | |
| #define | hi_forward(x) std::forward<decltype(x)>(x) |
| Forward a value, based on the decltype of the value. | |
| #define | hi_num_va_args_impl(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N, ...) N |
| #define | hi_num_va_args_(...) hi_num_va_args_impl(__VA_ARGS__) |
| #define | hi_num_va_args(...) |
| Get the number of arguments. | |
| #define | hi_parans () |
| #define | hi_expand1(...) __VA_ARGS__ |
| #define | hi_expand2(...) hi_expand1(hi_expand1(hi_expand1(hi_expand1(__VA_ARGS__)))) |
| #define | hi_expand3(...) hi_expand2(hi_expand2(hi_expand2(hi_expand2(__VA_ARGS__)))) |
| #define | hi_expand4(...) hi_expand3(hi_expand3(hi_expand3(hi_expand3(__VA_ARGS__)))) |
| #define | hi_expand(...) hi_expand4(hi_expand4(hi_expand4(hi_expand4(__VA_ARGS__)))) |
| Re-evaluate text up to 256 times by the pre-processor. | |
| #define | hi_for_each_again() hi_for_each_helper |
| #define | hi_for_each_helper(macro, first_arg, ...) macro(first_arg) __VA_OPT__(hi_for_each_again hi_parans(macro, __VA_ARGS__)) |
| #define | hi_for_each(macro, ...) __VA_OPT__(hi_expand(hi_for_each_helper(macro, __VA_ARGS__))) |
| Evaluate a macro for each argument. | |
| #define | hi_stringify_(x) #x |
| #define | hi_stringify(x) hi_stringify_(x) |
| #define | hi_cat_(a, b) a##b |
| #define | hi_cat(a, b) hi_cat_(a, b) |
| #define | hi_return_on_self_assignment(other) |
| #define | hi_unreachable() std::terminate() |
| #define | hi_assume(condition) static_assert(sizeof(condition) == 1) |
| #define | hi_force_inline inline |
| #define | hi_no_inline |
| #define | hi_restrict |
| #define | hi_warning_push() |
| #define | hi_warning_pop() |
| #define | hi_msvc_pragma(a) |
| #define | hi_warning_ignore_clang(a) |
| #define | msvc_pragma(a) |
| #define | hi_typename |
| #define | ssizeof(x) (static_cast<ssize_t>(sizeof(x))) |
Typedefs | |
| using | hi::v1::ssize_t = std::ptrdiff_t |
| Signed size/index into an array. | |
Functions | |
| hi_warning_ignore_msvc (26472) | |
| constexpr std::size_t | hi::v1::operator""_uz (unsigned long long lhs) noexcept |
| constexpr std::size_t | hi::v1::operator""_zu (unsigned long long lhs) noexcept |
| constexpr std::ptrdiff_t | hi::v1::operator""_z (unsigned long long lhs) noexcept |
Utilities used by the HikoGUI library itself.
This file includes required definitions.
| #define hi_expand | ( | ... | ) | hi_expand4(hi_expand4(hi_expand4(hi_expand4(__VA_ARGS__)))) |
Re-evaluate text up to 256 times by the pre-processor.
| ... | The text which needs to be re-evaluated by the pre-processor. |
| #define hi_for_each | ( | macro, | |
| ... ) __VA_OPT__(hi_expand(hi_for_each_helper(macro, __VA_ARGS__))) |
Evaluate a macro for each argument.
| macro | A macro that accepts a single argument. |
| ... | A set of arguments to be passed one-by-one to macro. |
| #define hi_forward | ( | x | ) | std::forward<decltype(x)>(x) |
Forward a value, based on the decltype of the value.
| #define hi_num_va_args | ( | ... | ) |
Get the number of arguments.
| ... | A set of arguments |
| #define hi_return_on_self_assignment | ( | other | ) |
| #define hilet auto const |
Invariant should be the default for variables.
C++ does have an invariant but it requires you to enter the 'const' keyword which is easy to forget. Using a single keyword 'hilet' for an invariant makes it easier to notice when you have defined a variant.