HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
required.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2019-2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
10#pragma once
11
12#include <cstddef>
13#include <string>
14#include <chrono>
15
16#ifndef hilet
23#define hilet auto const
24#endif
25
26#ifndef hi_forward
29#define hi_forward(x) std::forward<decltype(x)>(x)
30#endif
31
32namespace hi::inline v1 {
33
34
38
39#define ssizeof(x) (static_cast<ssize_t>(sizeof(x)))
40
41constexpr std::size_t operator"" _uz(unsigned long long lhs) noexcept
42{
43 return static_cast<std::size_t>(lhs);
44}
45
46constexpr std::size_t operator"" _zu(unsigned long long lhs) noexcept
47{
48 return static_cast<std::size_t>(lhs);
49}
50
51constexpr std::ptrdiff_t operator"" _z(unsigned long long lhs) noexcept
52{
53 return static_cast<std::ptrdiff_t>(lhs);
54}
55
56#define hi_return_on_self_assignment(other) \
57 if (&(other) == this) [[unlikely]] \
58 return *this;
59
60} // namespace hi::inline v1