12#include "../macros.hpp"
19hi_export_module(hikogui.utility.misc);
24hi_warning_ignore_msvc(26472);
27hi_warning_ignore_msvc(26473);
29hi_export
namespace hi {
inline namespace v1 {
35#define ssizeof(x) (static_cast<ssize_t>(sizeof(x)))
37constexpr std::size_t operator"" _uz(
unsigned long long lhs)
noexcept
42constexpr std::size_t operator"" _zu(
unsigned long long lhs)
noexcept
55template<
typename T,
typename U>
59 lhs = std::forward<U>(rhs);
71template<
typename T,
typename U>
74 return lhs.exchange(rhs, std::memory_order::relaxed) != rhs;
100template<
class T,
class U>
101[[
nodiscard]]
constexpr auto&& forward_like(U && x)
noexcept
103 constexpr bool is_adding_const = std::is_const_v<std::remove_reference_t<T>>;
104 if constexpr (std::is_lvalue_reference_v<T&&>) {
106 return std::as_const(x);
108 return static_cast<U&
>(x);
126hi_export
template<
typename CharT,
typename Traits = std::
char_traits<CharT>>
131 while (r.size() < max_size) {
133 if (c == Traits::eof()) {
136 }
else if (c ==
'\r') {
143 }
else if (c ==
'\n') {
147 r += Traits::to_char_type(c);
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
bool compare_store(T &lhs, U &&rhs) noexcept
Compare then store if there was a change.
Definition misc.hpp:56
hi_export std::basic_string< CharT, Traits > getline(std::basic_istream< CharT, Traits > &in, size_t max_size) noexcept
Get a line from an input string, upto a maximum size.
Definition misc.hpp:127
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Tag used for special functions or constructions to do a override compared to another function of the ...
Definition misc.hpp:79
Tag used in constructors to set the intrinsic value of that object.
Definition misc.hpp:86
A type that can not be constructed, copied, moved or destructed.
Definition misc.hpp:91