4#ifndef TETL_CHRONO_WEEKDAY_HPP
5#define TETL_CHRONO_WEEKDAY_HPP
7#include <etl/_chrono/duration.hpp>
8#include <etl/_chrono/last_spec.hpp>
9#include <etl/_chrono/local_t.hpp>
10#include <etl/_chrono/system_clock.hpp>
11#include <etl/_cstdint/uint_t.hpp>
22 constexpr explicit weekday(
unsigned wd)
noexcept
23 : _wd{
static_cast<
etl::uint8_t>(wd == 7 ? 0 : wd)}
27 constexpr weekday(sys_days
const& dp)
noexcept
32 constexpr explicit weekday(local_days
const& dp)
noexcept
78 return _wd == 0U ? 7U : _wd;
98 [[
nodiscard]]
static constexpr auto weekday_from_days(
int tp)
noexcept ->
etl::uint8_t
100 return static_cast<
etl::uint8_t>(tp >= -4 ? (tp + 4) % 7 : ((tp + 5) % 7) + 6);
124 return count >= 0 ? days{count} : days{count + 7};
constexpr auto operator-(weekday const &lhs, days const &rhs) noexcept -> weekday
Definition weekday.hpp:116
constexpr auto Saturday
Definition weekday.hpp:134
constexpr auto operator-(weekday const &lhs, weekday const &rhs) noexcept -> days
Definition weekday.hpp:121
constexpr auto operator+(weekday const &lhs, days const &rhs) noexcept -> weekday
Definition weekday.hpp:106
constexpr auto operator+(days const &lhs, weekday const &rhs) noexcept -> weekday
Definition weekday.hpp:111
constexpr auto Friday
Definition weekday.hpp:133
constexpr auto Wednesday
Definition weekday.hpp:131
constexpr auto Tuesday
Definition weekday.hpp:130
constexpr auto Monday
Definition weekday.hpp:129
constexpr auto Thursday
Definition weekday.hpp:132
constexpr auto Sunday
Definition weekday.hpp:128
Definition adjacent_find.hpp:9
constexpr auto count() const -> rep
Returns the number of ticks for this duration.
Definition duration.hpp:98
last_spec is an empty tag type that is used in conjunction with other calendar types to indicate the ...
Definition last_spec.hpp:20
constexpr auto time_since_epoch() const noexcept -> duration
Returns a duration representing the amount of time between *this and the clock's epoch.
Definition time_point.hpp:62
Definition weekday_indexed.hpp:12
Definition weekday_last.hpp:12
Definition weekday.hpp:19
constexpr auto operator--(int) noexcept -> weekday
Definition weekday.hpp:52
constexpr auto operator--() noexcept -> weekday &
Definition weekday.hpp:47
constexpr auto ok() const noexcept -> bool
Definition weekday.hpp:81
constexpr weekday(sys_days const &dp) noexcept
Definition weekday.hpp:27
constexpr auto operator[](etl::chrono::last_spec) const noexcept -> weekday_last
Definition weekday_last.hpp:37
constexpr auto operator+=(days const &d) noexcept -> weekday &
Definition weekday.hpp:57
constexpr auto operator++(int) noexcept -> weekday
Definition weekday.hpp:42
constexpr auto operator++() noexcept -> weekday &
Definition weekday.hpp:37
constexpr auto iso_encoding() const noexcept -> unsigned
Definition weekday.hpp:76
constexpr auto c_encoding() const noexcept -> unsigned
Definition weekday.hpp:71
constexpr weekday(unsigned wd) noexcept
Definition weekday.hpp:22
constexpr auto operator-=(days const &d) noexcept -> weekday &
Definition weekday.hpp:64
constexpr auto operator[](unsigned index) const noexcept -> weekday_indexed
Definition weekday_indexed.hpp:46
friend constexpr auto operator==(weekday const &lhs, weekday const &rhs) noexcept -> bool
Definition weekday.hpp:92
constexpr weekday(local_days const &dp) noexcept
Definition weekday.hpp:32