18namespace hi::inline
v1 {
152template<>
struct make_string<char8_t> {
using type = std::u8string; };
174template<
typename T,
typename U>
176 using type =
decltype(
static_cast<T
>(0) +
static_cast<U
>(0));
179template<
typename T,
typename U>
180using make_promote_t =
typename make_promote<T,U>::type;
182template<
typename T,
typename Ei=
void>
184 using type = uintmax_t;
187template<std::
unsigned_
integral T>
189 using type = uintmax_t;
192template<std::
signed_
integral T>
194 using type = intmax_t;
198using make_intmax_t =
typename make_intmax<T>::type;
298template<
typename L,
typename... R>
301template<std::
integral T>
306template<std::
unsigned_
integral L, std::
unsigned_
integral R>
308 using type = std::conditional_t<(
sizeof(L) >
sizeof(R)), L, R>;
311template<std::
signed_
integral L, std::
signed_
integral R>
313 using type = std::conditional_t<(
sizeof(L) >
sizeof(R)), L, R>;
316template<std::
unsigned_
integral L, std::
signed_
integral R>
317struct common_integer<L,R> {
319 std::conditional_t<(
sizeof(L) <
sizeof(
short)),
short,
320 std::conditional_t<(
sizeof(L) <
sizeof(int)), int,
321 std::conditional_t<(
sizeof(L) <
sizeof(
long)),
long,
long long>>>;
323 using type = common_integer<_left_type, R>::type;
326template<std::
signed_
integral L, std::
unsigned_
integral R>
327struct common_integer<L,R> {
328 using type = common_integer<R, L>::type;
331template<std::integral L, std::integral M, std::integral... R>
348template<std::integral L, std::integral... R>
352struct remove_cvptr {
using type = std::remove_cv_t<std::remove_pointer_t<T>>; };
355using remove_cvptr_t = remove_cvptr<T>::type;
359template<
typename To,
typename From,
typename Ei=
void>
362template<
typename To,
typename From>
requires(not std::is_const_v<From> and not std::is_volatile_v<From>)
364 using type = std::remove_cv_t<To>;
367template<
typename To,
typename From>
requires(not std::is_const_v<From> and std::is_volatile_v<From>)
369 using type = std::remove_cv_t<To>
volatile;
372template<
typename To,
typename From>
requires(std::is_const_v<From> and not std::is_volatile_v<From>)
373struct copy_cv<To,From> {
374 using type = std::remove_cv_t<To>
const;
377template<
typename To,
typename From>
requires(std::is_const_v<From> and std::is_volatile_v<From>)
378struct copy_cv<To,From> {
379 using type = std::remove_cv_t<To>
const volatile;
384template<
typename To,
typename From>
389 template <
typename C>
static std::true_type test(
typename C::value_type *);
392 static const bool value = std::is_same_v<decltype(test<T>(
nullptr)),
std::true_type>;
400 template <
typename C>
static std::true_type test(
decltype(&C::add_callback) func_ptr);
403 static const bool value = std::is_same_v<decltype(test<T>(
nullptr)),
std::true_type>;
409template<
typename BaseType,
typename DerivedType>
412template<
typename BaseType,
typename DerivedType>
415template<
typename DerivedType,
typename BaseType>
418template<
typename DerivedType,
typename BaseType>
421template<
typename DerivedType,
typename BaseType>
424template<
typename DerivedType,
typename BaseType>
430template<
typename Context,
typename Expected>
431constexpr bool is_different_v = not std::is_same_v<std::decay_t<Context>,std::decay_t<Expected>>;
442template<
typename First,
typename Second>
447template<
typename First,
typename Second>
459 constexpr static bool value =
false;
478#define hi_call_method(object, method, ...) \
480 if constexpr (smart_pointer_traits<std::decay_t<decltype(object)>>::value) { \
481 return object->method(__VA_ARGS__); \
483 return object.method(__VA_ARGS__); \
489template<
typename Out,
typename In>
530template<
typename Context,
typename Expected,
typename... OtherExpected>
533template<
typename Context,
typename Expected,
typename FirstOtherExpected,
typename... OtherExpected>
534struct is_forward_of<Context, Expected, FirstOtherExpected, OtherExpected...> : std::conditional_t<
535 is_forward_of<Context, Expected>::value or
536 (is_forward_of<Context, FirstOtherExpected>::value or ... or is_forward_of<Context, OtherExpected>::value),
540template<
typename Context,
typename Expected>
543 std::is_same_v<std::decay_t<Context>, Expected> or std::is_base_of_v<Expected, std::decay_t<Context>>,
546 static_assert(not std::is_reference_v<Expected>,
"Template argument Expected must be a non-reference type.");
549template<
typename Context,
typename Expected>
552 std::is_convertible_v<Context, std::shared_ptr<Expected>>,
556template<
typename Context,
typename Expected>
559 std::is_convertible_v<Context, std::weak_ptr<Expected>>,
563template<
typename Context,
typename Expected>
566 std::is_convertible_v<Context, std::unique_ptr<Expected>>,
570template<
typename Context,
typename Expected>
573 std::is_convertible_v<Context, Expected *>,
577template<
typename Context,
typename Result,
typename... Args>
579 std::conditional_t<std::is_invocable_r_v<Result, Context, Args...>, std::true_type, std::false_type> {
582template<
typename Context,
typename Expected,
typename... OtherExpected>
583constexpr bool is_forward_of_v =
is_forward_of<Context, Expected, OtherExpected...>::value;
585template<
typename Context>
587 using type = std::conditional_t<std::is_rvalue_reference_v<Context>, std::decay_t<Context>, std::decay_t<Context>
const &>;
590template<
typename Context>
591using forward_copy_or_ref_t = forward_copy_or_ref<Context>::type;
600 using type = std::decay_t<T>;
605 using type = std::monostate;
673 using Ts::operator()...;
Functions and macros for handling architectural difference between compilers, CPUs and operating syst...
DOXYGEN BUG.
Definition algorithm.hpp:13
common_integer< L, R... >::type common_integer_t
Get an integer type that will fit all values from all template parameters.
Definition type_traits.hpp:349
constexpr bool is_numeric_v
Definition type_traits.hpp:110
constexpr bool is_different_v
If the types are different.
Definition type_traits.hpp:431
typename make_string< T >::type make_string_t
type-trait to convert a character to a string type.
Definition type_traits.hpp:158
typename make_string_view< T >::type make_string_view_t
type-trait to convert a character to a string_view type.
Definition type_traits.hpp:172
__int128 int128_t
Signed 128 bit integer.
Definition architecture.hpp:180
constexpr bool is_numeric_unsigned_integral_v
Definition type_traits.hpp:58
variant_decay< T >::type variant_decay_t
Definition type_traits.hpp:611
unsigned __int128 uint128_t
Unsigned 128 bit integer.
Definition architecture.hpp:184
constexpr bool is_byte_like_v
An array of this type will implicitly create objects within that array.
Definition type_traits.hpp:145
typename copy_cv< To, From >::type copy_cv_t
Type-trait to copy const volatile qualifiers from one type to another.
Definition type_traits.hpp:385
constexpr bool is_numeric_integral_v
Definition type_traits.hpp:82
constexpr bool type_in_range_v
All values of numeric type In can be represented without loss of range by numeric type Out.
Definition type_traits.hpp:490
constexpr bool is_character_v
Definition type_traits.hpp:127
constexpr bool is_numeric_signed_integral_v
Definition type_traits.hpp:39
Is a numeric signed integer.
Definition type_traits.hpp:29
Is a numeric unsigned integer.
Definition type_traits.hpp:48
Is a numeric integer.
Definition type_traits.hpp:68
Is a numeric.
Definition type_traits.hpp:93
Definition type_traits.hpp:112
An array of this type will implicitly create objects within that array.
Definition type_traits.hpp:133
type-trait to convert a character to a string type.
Definition type_traits.hpp:149
type-trait to convert a character to a string_view type.
Definition type_traits.hpp:162
Definition type_traits.hpp:175
Definition type_traits.hpp:183
Has an signed integer of a specific size, natively supported by the compiler.
Definition type_traits.hpp:203
Has an unsigned integer of a specific size, natively supported by the compiler.
Definition type_traits.hpp:208
Has an float of a specific size, natively supported by the compiler.
Definition type_traits.hpp:213
Has an signed integer of a specific size.
Definition type_traits.hpp:218
Has an unsigned integer of a specific size.
Definition type_traits.hpp:223
Has an float of a specific size.
Definition type_traits.hpp:229
Make an signed integer.
Definition type_traits.hpp:234
Make an unsigned integer.
Definition type_traits.hpp:239
Make an floating point.
Definition type_traits.hpp:244
Get an integer type that will fit all values from all template parameters.
Definition type_traits.hpp:299
Definition type_traits.hpp:352
Type-trait to copy const volatile qualifiers from one type to another.
Definition type_traits.hpp:360
Definition type_traits.hpp:388
Definition type_traits.hpp:399
Definition type_traits.hpp:410
Definition type_traits.hpp:416
Definition type_traits.hpp:422
Definition type_traits.hpp:434
Definition type_traits.hpp:443
Smart pointer traits.
Definition type_traits.hpp:456
void type
The type the pointer points to.
Definition type_traits.hpp:463
Is context a form of the expected type.
Definition type_traits.hpp:531
Definition type_traits.hpp:586
Decays types for use as elements in std::variant.
Definition type_traits.hpp:599
This selector allows access to member variable by name.
Definition type_traits.hpp:642
Documentation of a type.
Definition type_traits.hpp:662
Helper type to turn a set of lambdas into a single overloaded type to pass to std::visit().
Definition type_traits.hpp:671