HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
required.hpp
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
5#pragma once
6
7#include <cstddef>
8#include <string>
9#include <chrono>
10
11namespace tt {
12
18#ifndef ttlet
19#define ttlet auto const
20#endif
21
24using ssize_t = std::ptrdiff_t;
25
26#define ssizeof(x) (static_cast<ssize_t>(sizeof(x)))
27
28constexpr size_t operator"" _uz(unsigned long long lhs) noexcept
29{
30 return static_cast<size_t>(lhs);
31}
32
33constexpr size_t operator"" _zu(unsigned long long lhs) noexcept
34{
35 return static_cast<size_t>(lhs);
36}
37
38constexpr ssize_t operator"" _z(unsigned long long lhs) noexcept
39{
40 return static_cast<ssize_t>(lhs);
41}
42
43#define tt_return_on_self_assignment(other)\
44 if (&(other) == this) [[unlikely]] return *this;
45
46} // namespace tt