std::chrono:: last_spec, std::chrono:: last
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
헤더 파일에 정의됨
<chrono>
|
||
|
struct
last_spec
{
|
(C++20부터) | |
|
inline
constexpr
last_spec last
{
}
;
|
(C++20부터) | |
last_spec
는 시퀀스에서 마지막 항목을 나타내기 위해 다른 달력 유형과 함께 사용되는 빈 태그 유형입니다. 상황에 따라 월의 마지막 날(예:
2018y
/
February
/
last
, 2018년 2월의 마지막 날, 즉 2018-02-28) 또는 월의 마지막 주 특정 요일(예:
2018
/
February
/
Sunday
[
last
]
, 2018년 2월의 마지막 일요일, 즉 2018-02-25)을 나타낼 수 있습니다.
예제
#include <chrono> int main() { using namespace std::chrono; constexpr auto mdl {June/last}; static_assert(mdl == month_day_last(month(6))); constexpr auto ymwdl {year(2023)/December/Tuesday[last]}; static_assert(ymwdl == year_month_weekday_last(year(2023), month(12), weekday_last(Tuesday))); }