7#include "../concurrency/concurrency.hpp"
8#include "../macros.hpp"
14hi_export_module(hikogui.GUI : widget_id);
16hi_export
namespace hi {
inline namespace v1 {
18inline id_factory<uint32_t> widget_id_factory;
21enum class widget_id : uint32_t {};
23[[nodiscard]]
inline widget_id make_widget_id() noexcept
25 return static_cast<widget_id
>(detail::widget_id_factory.acquire());
28inline void release_widget_id(widget_id
id)
noexcept
30 detail::widget_id_factory.release(std::to_underlying(
id));
33[[nodiscard]]
constexpr bool operator==(widget_id
const& lhs, std::integral
auto const& rhs)
noexcept
35 return std::cmp_equal(std::to_underlying(lhs), rhs);
38[[nodiscard]]
constexpr std::strong_ordering operator<=>(widget_id
const& lhs, std::integral
auto const& rhs)
noexcept
40 if (std::cmp_equal(std::to_underlying(lhs), rhs)) {
41 return std::strong_ordering::equal;
42 }
else if (std::cmp_less(std::to_underlying(lhs), rhs)) {
43 return std::strong_ordering::less;
45 return std::strong_ordering::greater;
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20