Le mardi 30 novembre 2004 à 11:34, Siemel Naran a écrit dans
comp.lang.c++*:
Is there any trick to avoid typos in set functions, such as
void date::set(int day, int month, int year) {
d_day = day;
month = month; // oops: should be d_month = month
d_year = year;
}
const parameters can help in this case.
void date::set(const int day,const int month,const int year)
{
d_day = day;
month = month; // oops: compilation error
d_year = year;
}
--
___________ 2004-11-30 12:08:04
_/ _ \_`_`_`_) Serge PACCALIN -- sp ad mailclub.net
\ \_L_) Il faut donc que les hommes commencent
-'(__) par n'être pas fanatiques pour mériter
_/___(_) la tolérance. -- Voltaire, 1763