Updated Examples and Recipes (markdown)

Howard Hinnant
2017-03-28 21:34:13 -04:00
parent 8b28dc683d
commit fb5074d4e3

@@ -1356,18 +1356,18 @@ First the code, and then a detailed explanation:
{
case 0:
// Output month and year title
os << left << setw(21) << format(os.getloc(), " %B %Y", sys_days{ym/1}) << right;
os << left << setw(21) << format(os.getloc(), " %B %Y", ym) << right;
break;
case 1:
{
// Output weekday names title
auto sd = sys_days{ym/firstdow[1]};
for (auto const esd = sd + weeks{1}; sd < esd; sd += days{1})
auto wd = first dow;
do
{
auto d = format(os.getloc(), "%a", sd);
auto d = format(os.getloc(), "%a", wd);
d.resize(2);
os << ' ' << d;
}
} while (++wd != firstdow);
break;
}
case 2:
@@ -1378,7 +1378,7 @@ First the code, and then a detailed explanation:
auto d = 1_d;
do
{
os << setw(3) << unsigned(d);
os << format(" %e", d);
++d;
} while (++wd != firstdow);
break;
@@ -1399,7 +1399,7 @@ First the code, and then a detailed explanation:
auto wd = firstdow;
do
{
os << setw(3) << unsigned(d);
os << format(" %e", d);
} while (++wd != firstdow && ++d <= e);
// Append row with spaces if the week did not complete
os << string(static_cast<unsigned>((firstdow-wd).count())*3, ' ');