The whole value idiom represents a meaningful quantity with a lightweight type instead of a bare primitive. The type carries semantics such as a calendar unit and helps ensure that arguments appear in the correct order. section 4.1
A typed calendar date
std::chrono::year_month_day requires an std::chrono::year, std::chrono::month, and std::chrono::day. Passing a month where a day is expected produces a compiler error, catching the mistake early and precisely. section 4.1
Listing 4.1 Creating a specific date
auto new_years_eve = std::chrono::year_month_day( std::chrono::year(2022), std::chrono::month(12), std::chrono::day(31) );
Create New Year’s Eve by passing explicitly typed year, month, and day values. section 4.1
