// Code derived from Stroustrup's PPP2 book// § 9.4.2 Member functions and constructors// -and beginning on p 310#include<iostream>usingnamespacestd;// simple Date (too simple?):structDate{inty;// yearintm;// month in yearintd;// day of month};//------------------------------------------------------------------------------// helper functions:voidinit_day(Date&dd,inty,intm,intd){// check that (y,m,d) is a valid date// if it is, use it to initialize ddcout<<dd.y<<y<<m<<d<<'\n';}ostream&operator<<(ostream&os,constDate&d){returnos<<'{'<<d.y<<','<<d.m<<','<<d.d<<'}';}//------------------------------------------------------------------------------voidf(){[[maybe_unused]]Datetoday;// ...init_day(today,12,24,2005);// oops! (no day 2005 in year 12)// ...[[maybe_unused]]Datetomorrow;tomorrow.y=today.y;tomorrow.m=today.m;tomorrow.d=today.d+1;// add 1 to today}intmain(){f();}