mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-06 14:14:27 +02:00
Updated Examples and Recipes (markdown)
@@ -134,17 +134,17 @@ Example:
|
||||
{
|
||||
using namespace date;
|
||||
auto ymd = 2015_y/55/250;
|
||||
std::cout << ymd << '\n';
|
||||
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||
ymd += months{0};
|
||||
std::cout << ymd << '\n';
|
||||
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||
ymd = day_point(ymd);
|
||||
std::cout << ymd << '\n';
|
||||
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||
}
|
||||
|
||||
Outputs:
|
||||
|
||||
2015-55-250
|
||||
2019-07-250
|
||||
2015-55-250 invalid date
|
||||
2019-07-250 invalid date
|
||||
2020-03-06
|
||||
|
||||
The specifications for these functions do not yet guarantee this "normalization behavior." But the implementation has been thoroughly tested for this behavior and the specification will be updated soon.
|
||||
|
Reference in New Issue
Block a user