Fix example in C.51 (#1294)

The example looks like it previously used i to represent date, but now the variable is called d. I updated the use and related parameters to match.
This commit is contained in:
Kyle 2018-11-29 10:02:41 -07:00 committed by Sergey Zubkov
parent 50b9cefe39
commit 0181ab40a7

View File

@ -5683,13 +5683,13 @@ To avoid repetition and accidental differences.
Month m; Month m;
int y; int y;
public: public:
Date(int ii, Month mm, year yy) Date(int dd, Month mm, year yy)
:i{ii}, m{mm}, y{yy} :d{dd}, m{mm}, y{yy}
{ if (!valid(i, m, y)) throw Bad_date{}; } { if (!valid(d, m, y)) throw Bad_date{}; }
Date(int ii, Month mm) Date(int dd, Month mm)
:i{ii}, m{mm} y{current_year()} :d{dd}, m{mm} y{current_year()}
{ if (!valid(i, m, y)) throw Bad_date{}; } { if (!valid(d, m, y)) throw Bad_date{}; }
// ... // ...
}; };
@ -5702,12 +5702,12 @@ The common action gets tedious to write and may accidentally not be common.
Month m; Month m;
int y; int y;
public: public:
Date2(int ii, Month mm, year yy) Date2(int dd, Month mm, year yy)
:i{ii}, m{mm}, y{yy} :d{dd}, m{mm}, y{yy}
{ if (!valid(i, m, y)) throw Bad_date{}; } { if (!valid(d, m, y)) throw Bad_date{}; }
Date2(int ii, Month mm) Date2(int dd, Month mm)
:Date2{ii, mm, current_year()} {} :Date2{dd, mm, current_year()} {}
// ... // ...
}; };