std::chrono::weekday_indexed:: weekday
From cppreference.net
<
cpp
|
chrono
|
weekday indexed
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::weekday_indexed
| Member functions | ||||
|
weekday_indexed::weekday
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
std::
chrono
::
weekday
weekday
(
)
const
noexcept
;
|
(C++20부터) | |
저장된 std::chrono::weekday 객체의 복사본을 * this 에서 가져옵니다.
반환값
std::chrono::weekday 객체에 저장된 사본을 * this 에 반환합니다.
예제
이 코드 실행
#include <chrono> #include <iostream> int main() { std::cout << std::boolalpha; // 월의 두 번째 화요일 std::chrono::weekday_indexed wdi{std::chrono::Tuesday[2]}; std::cout << (std::chrono::year_month_day{wdi/10/2019} == std::chrono::year_month_day{std::chrono::October/8/2019}) << ' '; // 두 번째 화요일 => 두 번째 목요일 wdi = {wdi.weekday() + std::chrono::days(2), wdi.index()}; std::cout << (std::chrono::year_month_day{wdi/10/2019} == std::chrono::year_month_day{std::chrono::October/10/2019}) << '\n'; }
출력:
true true
참고 항목
|
저장된 인덱스에 접근
(public member function) |