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))); }