14namespace tcspc::internal {
19#define LIBTCSPC_NOINLINE [[gnu::noinline]]
20#elif defined(_MSC_VER)
21#define LIBTCSPC_NOINLINE [[msvc::noinline]]
23#define LIBTCSPC_NOINLINE
28inline auto is_aligned(
void const *ptr)
noexcept ->
bool {
30 auto const start =
reinterpret_cast<uintptr_t
>(ptr);
31 return start %
alignof(T) == 0;
35[[noreturn]]
inline void unreachable() {
38 __builtin_unreachable();
39#elif defined(_MSC_VER)
46template <
typename T>
struct always_false : std::false_type {};
49inline constexpr bool always_false_v = always_false<T>::value;
51template <
typename T,
typename... U>
52concept same_as_any_of = (std::same_as<T, U> || ...);
55template <
typename... Ts>
struct overloaded : Ts... {
56 using Ts::operator()...;
58template <
typename... Ts> overloaded(Ts...) -> overloaded<Ts...>;