Updated Examples and Recipes (markdown)

HowardHinnant
2015-08-01 23:58:14 -04:00
parent 6d158cef5f
commit 8033749d07

@@ -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.