45 std::int_fast8_t hour, std::int_fast8_t minute, std::int_fast8_t second = 0, std::int32_t nano = 0)
56 [[nodiscard]]
constexpr std::int_fast8_t
get_hour() const noexcept {
return m_hour; }
61 [[nodiscard]]
constexpr std::int_fast8_t
get_minute() const noexcept {
return m_minute; }
66 [[nodiscard]]
constexpr std::int_fast8_t
get_second() const noexcept {
return m_second; }
71 [[nodiscard]]
constexpr std::int32_t
get_nano() const noexcept {
return m_nano; }
80 if (m_hour != other.m_hour) {
81 return m_hour - other.m_hour;
83 if (m_minute != other.m_minute) {
84 return m_minute - other.m_minute;
86 if (m_second != other.m_second) {
87 return m_second - other.m_second;
89 return m_nano - other.m_nano;
93 std::int_least8_t m_hour = 0;
94 std::int_least8_t m_minute = 0;
95 std::int_least8_t m_second = 0;
96 std::int_least32_t m_nano = 0;
106constexpr bool operator==(
const ignite_time &lhs,
const ignite_time &rhs)
noexcept {
107 return lhs.compare(rhs) == 0;
118 return lhs.compare(rhs) != 0;
129 return lhs.compare(rhs) < 0;
140 return lhs.compare(rhs) <= 0;
151 return lhs.compare(rhs) > 0;
162 return lhs.compare(rhs) >= 0;
A time of day with nanosecond precision.
Definition ignite_time.h:29
constexpr std::int_fast8_t get_second() const noexcept
Definition ignite_time.h:66
constexpr std::int_fast8_t get_minute() const noexcept
Definition ignite_time.h:61
constexpr std::int_fast8_t get_hour() const noexcept
Definition ignite_time.h:56
constexpr ignite_time() noexcept=default
constexpr int compare(const ignite_time &other) const noexcept
Definition ignite_time.h:79
constexpr std::int32_t get_nano() const noexcept
Definition ignite_time.h:71