File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class MutantStack : public std::stack<T, C>
1313 operator = (const MutantStack<T, C> &rhs)
1414 {
1515 if (this != &rhs)
16- this ->c .operator = (rhs);
16+ this ->c .operator = (rhs. c );
1717 return (*this );
1818 };
1919 ~MutantStack<T, C> (){};
Original file line number Diff line number Diff line change @@ -59,4 +59,21 @@ main (void)
5959 ite3 = mstack3.end ();
6060 for (; it3 != ite3; ++it3)
6161 print (*it3);
62+
63+ print (SUB_TITTLE YELLOW " Copy construcor" RESET );
64+ MutantStack<float , std::list<float > > copy (mstack3);
65+ MutantStack<float , std::list<float > >::iterator it4, ite4;
66+ it4 = copy.begin ();
67+ ite4 = copy.end ();
68+ for (; it4 != ite4; ++it4)
69+ print (*it4);
70+
71+ print (SUB_TITTLE YELLOW " Assignment operator" RESET );
72+ MutantStack<float , std::list<float > > assign;
73+ assign = mstack3;
74+ MutantStack<float , std::list<float > >::iterator it5, ite5;
75+ it5 = assign.begin ();
76+ ite5 = assign.end ();
77+ for (; it5 != ite5; ++it5)
78+ print (*it5);
6279}
You can’t perform that action at this time.
0 commit comments