Update time_of_day to be more consistent ...

the needs of formatting.
This commit is contained in:
Howard Hinnant committed 2019-02-02 14:06:12 -05:00
1 parent f1326968af
commit 9cb0013aef
11 files changed
+184 -689

No files matched your search

+1 -5
View File
@@ -79,7 +79,6 @@ main()
static_assert(t1.hours() == hours{13}, "");
static_assert(t1.minutes() == minutes{7}, "");
static_assert(t1.seconds() == seconds{5}, "");
static_assert(t1.mode() == 0, "");
#if __cplusplus >= 201402
static_assert(static_cast<tod::precision>(t1) == hours{13} + minutes{7}
+ seconds{5}, "");
@@ -90,7 +89,6 @@ main()
assert(t2.hours() == t1.hours());
assert(t2.minutes() == t1.minutes());
assert(t2.seconds() == t1.seconds());
assert(t2.mode() == t1.mode());
assert(t2.to_duration() == t1.to_duration());
ostringstream os;
os << t2;
@@ -100,16 +98,14 @@ main()
assert(t2.hours() == hours{1});
assert(t2.minutes() == minutes{7});
assert(t2.seconds() == seconds{5});
assert(t2.mode() == pm);
assert(t2.to_duration() == t1.to_duration());
os << t2;
assert(os.str() == "1:07:05pm");
assert(os.str() == "1:07:05PM");
t2.make24();
os.str("");
assert(t2.hours() == hours{13});
assert(t2.minutes() == minutes{7});
assert(t2.seconds() == seconds{5});
assert(t2.mode() == 0);
assert(t2.to_duration() == t1.to_duration());
os << t2;
assert(os.str() == "13:07:05");