From 8033749d07324d58bff997530e1efdf5696f528a Mon Sep 17 00:00:00 2001 From: HowardHinnant Date: Sat, 1 Aug 2015 23:58:14 -0400 Subject: [PATCH] Updated Examples and Recipes (markdown) --- Examples-and-Recipes.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples-and-Recipes.md b/Examples-and-Recipes.md index 6db4e11..7dbca56 100644 --- a/Examples-and-Recipes.md +++ b/Examples-and-Recipes.md @@ -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.