#pragma once using uint8_t = unsigned char; using uint16_t = unsigned short; using uint32_t = unsigned int; using uint64_t = unsigned long long; using int8_t = signed char; using int16_t = signed short; using int32_t = signed int; using int64_t = signed long long; using size_t = uint64_t; using uintptr_t = uint64_t; static_assert(sizeof(size_t) == sizeof(void*), "size_t should be pointer size"); static_assert(sizeof(uintptr_t) == sizeof(void*), "size_t should be pointer size"); namespace std { template concept integral = __is_integral(T); template concept signed_integral = integral && __is_signed(T); template concept unsigned_integral = integral && __is_unsigned(T); template constexpr bool is_trivially_destructible_v = __is_trivially_destructible(T); template constexpr bool is_constructible_v = __is_constructible(T, Args...); template constexpr bool is_default_constructible_v = __is_constructible(T); template constexpr bool is_copy_constructible_v = __is_constructible(T, const T&); template constexpr bool is_move_constructible_v = __is_constructible(T, T&&); template constexpr bool is_copy_assignable_v = __is_assignable(T, const T&); template constexpr bool is_move_assignable_v = __is_assignable(T, T&&); template constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T); template constexpr bool _is_same_helper = false; template constexpr bool _is_same_helper = true; template concept same_as = _is_same_helper && _is_same_helper; template struct make_void { using type = void; }; template using void_t = make_void::type; template struct _add_reference_helper { using lvalue = T; using rvalue = T; }; template struct _add_reference_helper> { using lvalue = T&; using rvalue = T&&; }; template using add_lvalue_reference_t = _add_reference_helper::lvalue; template using add_rvalue_reference_t = _add_reference_helper::rvalue; template struct remove_reference { using type = T; }; template struct remove_reference { using type = T; }; template struct remove_reference { using type = T; }; template using remove_reference_t = remove_reference::type; template consteval add_rvalue_reference_t declval() { static_assert(false, "Don't use declval outside of constant evaluation"); } template concept convertible_to = __is_convertible(From, To) && requires { static_cast(declval()); }; template constexpr remove_reference_t&& move(T&& r) noexcept { return static_cast&&>(r); } template constexpr T&& forward(remove_reference_t& r) noexcept { return static_cast(r); } template constexpr T&& forward(remove_reference_t&& r) noexcept // NOLINT { return static_cast(r); } template constexpr T exchange(T& obj, U&& new_value) { T old_value = std::move(obj); obj = std::forward(new_value); return old_value; } enum __attribute__((__may_alias__)) byte : uint8_t {}; static_assert(sizeof(byte) == 1, ""); template requires (sizeof(To) == sizeof(From)) && is_trivially_copyable_v && is_trivially_copyable_v constexpr To bit_cast(const From& from) noexcept { return __builtin_bit_cast(To, from); } template class initializer_list { const T* m_begin = nullptr; size_t m_size = 0; public: constexpr initializer_list() noexcept = default; constexpr size_t size() const noexcept { return m_size; } constexpr const T* begin() const noexcept { return m_begin; } constexpr const T* end() const noexcept { return m_begin + m_size; } }; } // namespace std static_assert(std::same_as, ""); static_assert(!std::same_as, ""); static_assert(std::same_as, int>, ""); static_assert(std::same_as, int>, ""); static_assert(std::same_as, int>, ""); static_assert(std::same_as, int&>, ""); static_assert(std::same_as, int&>, ""); static_assert(std::same_as, int&>, ""); static_assert(std::same_as, void>, ""); static_assert(std::same_as, int&&>, ""); static_assert(std::same_as, int&>, ""); static_assert(std::same_as, int&&>, ""); static_assert(std::same_as, void>, ""); static_assert(std::convertible_to, ""); static_assert(!std::convertible_to, ""); constexpr void* operator new(size_t, void* ptr) { return ptr; }