std::chrono::weekday - cppreference.com
From cppreference.com
| Defined in header |
||
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
|
|
(since C++20) | |
The class weekday represent a day of the week in the proleptic Gregorian calendar. Its normal range is [0, 6], for Sunday through Saturday, but it can hold any value in the range [0, 255]. Seven named constants are predefined in the std::chrono namespace for the seven days of the week.
weekday is a TriviallyCopyable StandardLayoutType.
Member functions
constructs a weekday (public member function) [edit] | |
| increments or decrements the weekday (public member function) [edit] | |
| adds or subtracts a number of days (public member function) [edit] | |
| retrieves the stored weekday value retrieves ISO 8601 weekday value (public member function) [edit] | |
| checks if the stored weekday value is valid (public member function) [edit] | |
convenience syntax for constructing a weekday_indexed or weekday_last from this weekday (public member function) [edit] |
Nonmember functions
Helper classes
Example
#include <chrono> #include <iostream> int main() { std::chrono::weekday x{42 / 13}; std::cout << x++ << '\n'; std::cout << x << '\n'; std::cout << ++x << '\n'; }
Output: