33 #include <type_traits> 39 template <
typename Fn,
typename... Args>
42 template <
typename Fn,
typename... Args>
43 constexpr
bool invocable = std::is_invocable_v<Fn, Args...>;
46 constexpr
bool movable = std::is_object_v<T>&& std::is_move_constructible_v<T>&&
47 std::is_assignable_v<T&, T>&& std::is_swappable_v<T>;
52 template <
typename From,
typename To>
55 template <
typename T,
typename Cmp = T,
typename =
void>
58 template <
typename T,
typename Cmp>
61 typename std::enable_if_t<
63 decltype((std::declval<std::remove_reference_t<T> const&>() ==
64 std::declval<std::remove_reference_t<Cmp> const&>()) &&
65 (std::declval<std::remove_reference_t<T> const&>() !=
66 std::declval<std::remove_reference_t<Cmp> const&>()),
67 (void)0)>> : std::true_type {};
70 template <
typename T,
typename Cmp = T>
80 using Ref = std::reference_wrapper<T>;
85 std::reference_wrapper<std::add_const_t<std::remove_reference_t<T>>>;
90 std::reference_wrapper<std::remove_const_t<std::remove_reference_t<T>>>;
92 #if defined(__cpp_concepts) 93 #if __cpp_concepts >= 201907L 94 template <
typename T,
typename Base>
95 concept Impl = std::is_base_of_v<Base, T>;
110 constexpr
int kxPtrFmtSize =
static_cast<int>((
sizeof(
void*) << 1) + 2 + 2);
constexpr int kU16FmtSize
5 digits
Definition: common.h:124
std::reference_wrapper< std::remove_const_t< std::remove_reference_t< T > >> MutRef
MutRef is an always-mutable Ref
Definition: common.h:90
constexpr int kU32FmtSize
10 digits
Definition: common.h:120
std::reference_wrapper< std::add_const_t< std::remove_reference_t< T > >> ConstRef
ConstRef is an always-const Ref.
Definition: common.h:85
std::reference_wrapper< T > Ref
Definition: common.h:80
constexpr bool equality_comparable
Checks if the type has a compatible 'operator ==' and 'operator!='.
Definition: common.h:71
constexpr bool copy_constructible
Definition: common.h:50
constexpr bool invocable
Definition: common.h:43
constexpr int kI16FmtSize
5 digits + 1 sign
Definition: common.h:122
constexpr bool convertible
Definition: common.h:53
constexpr bool movable
Definition: common.h:46
constexpr int kI8FmtSize
3 digits + 1 sign
Definition: common.h:126
typename std::invoke_result_t< Fn, Args... > invoke_result
Definition: common.h:40
#define STX_END_NAMESPACE
Definition: config.h:329
constexpr int kI32FmtSize
10 digits + 1 sign
Definition: common.h:118
constexpr int kxPtrFmtSize
Definition: common.h:110
constexpr int kU8FmtSize
3 digits
Definition: common.h:128
#define STX_BEGIN_NAMESPACE
Definition: config.h:325
constexpr bool is_reference
Definition: common.h:74