#include #include "stack.cc" template ostream & operator << (ostream & os, const Stack & mis) { Stack copy(mis); os << "("; while (copy.Size() > 1) { os << copy.Top() << ", "; copy.Pop(); } os << copy.Top() << ")" << endl; return os; } template void Print(ostream & os, const Stack & s) { Stack copy(s); os << "("; while (copy.Size() > 1) { os << copy.Top() << ", "; copy.Pop(); } os << copy.Top() << ")" << endl; } int main() { Stack is; Stack > metas; int k; for(k=0; k < 10; k++) { is.Push(k); metas.Push(is); } cout << is << endl; cout << metas << endl; while (! is.IsEmpty()) is.Pop(); is.Pop(); return 0; }