listinit)~listclear)delete headdelete taillistconst list rhs init)forauto rhs push_backx )list operatorconst list rhs list copy rhsstd::swap*thiscopy )return *thislistlist &rhs thesizerhs thesize }headrhs head }tailrhs tail rhs thesize rhs head nullptrrhs tail nullptrlist operatorlist &rhs std::swapthesizerhs thesize )std::swapheadrhs head )std::swaptailrhs tail )return *thisvoid initthesize head new nodetail new nodehead->next tailtail->prev headfigure constructorbig-fiveand private init routine for list class