std::chrono...hrono::last(3)
π NAME π
Okay bestie, welcome to the std::chrono...hrono::last(3) page from the C++ Standard Libary manual β yes, that manual name is spelled exactly like that, and we're keeping it, no cap. This is the whole std::chrono::last_spec,std::chrono::last situation, and it's giving iconic empty-tag-type energy β¨.
std::chrono::last_spec,std::chrono::last β std::chrono::last_spec,std::chrono::last (the description is literally the name again, and honestly? self-referential queen behavior π
).
β¨ Synopsis β¨
Defined in header <chrono> β that's where this cutie lives π¦.
struct last_spec
{ (since C++20)
explicit last_spec() = default;
};
inline constexpr last_spec last{}; (since C++20)
last_spec is an empty tag type that is used in conjunction with other calendar types to indicate the last thing in a sequence. Depending on context, it may indicate the last day of a month (as in 2018y/February/last, for last day of February 2018, i.e., 2018-02-28) or the last day of the week in a month (as in 2018/February/Sunday[last], for last Sunday of February 2018, i.e. 2018-02-25) ποΈπ.
π Example π
Run this code, bestie β it's literally right here π
// Run this code
#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)));
}
Source/version/date check, bestie: http://cppreference.com, 2024.06.10, and the page is std::chrono...hrono::last(3). That's the whole footer wrapped in a bow π. Byeee! π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms