7#include "../utility/utility.hpp"
8#include "../macros.hpp"
15hi_export_module(hikogui.i18n.iso_3166 : intf);
17hi_export
namespace hi::inline
v1 {
28 constexpr iso_3166() noexcept : _v(0) {}
30 constexpr iso_3166(uint16_t number) : _v(number)
32 hi_check(number <= 999,
"ISO-3166 number must be between 0 and 999, got {}", number);
35 constexpr iso_3166(std::string_view str);
37 constexpr iso_3166(std::in_place_t, uint16_t v) noexcept : _v(v)
42 [[nodiscard]]
constexpr uint16_t
const& intrinsic()
const noexcept
47 [[nodiscard]]
constexpr uint16_t& intrinsic()
noexcept
52 [[nodiscard]]
constexpr bool empty()
const noexcept
57 constexpr explicit operator bool()
const noexcept
62 [[nodiscard]]
constexpr uint16_t number()
const noexcept
67 [[nodiscard]]
constexpr std::string code2()
const noexcept;
68 [[nodiscard]]
constexpr std::string code3()
const noexcept;
75 [[nodiscard]]
constexpr friend bool operator==(
iso_3166 const& lhs,
iso_3166 const& rhs)
noexcept =
default;
76 [[nodiscard]]
constexpr friend auto operator<=>(
iso_3166 const& lhs,
iso_3166 const& rhs)
noexcept =
default;
86 return lhs.empty() or lhs == rhs;
97 [[nodiscard]]
size_t operator()(hi::iso_3166
const& rhs)
const noexcept
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
ISO-3166 country code.
Definition iso_3166_intf.hpp:21
constexpr friend bool matches(iso_3166 const &lhs, iso_3166 const &rhs) noexcept
Check if rhs matches with lhs.
Definition iso_3166_intf.hpp:84