#include "stack.h" using namespace std; int main() { // {//Kopieringskonstruktor // Stack stack{}; // for(int i{}; i < 5; ++i) // { // stack.push("task" + to_string(i)); // } // Stack stack2{stack}; // } // {//Tilldelningsoperator // Stack stack{}; // for(int i{}; i < 5; ++i) // { // stack.push("task" + to_string(i)); // } // Stack stack2 = stack; // } // {//Flyttkonstruktor // Stack stack{}; // for(int i{}; i < 5; ++i) // { // stack.push("task" + to_string(i)); // } // Stack stack2{move(stack)}; // } // {//Flyttilldelningsoperator // Stack stack{}; // for(int i{}; i < 5; ++i) // { // stack.push("task" + to_string(i)); // } // Stack stack2 = move(stack); // } { Stack stack{}; for(int i{}; i < 5; ++i) { stack.push("book" + to_string(i)); } cout << stack.to_string() << endl; for(int i{}; i < 5; ++i) { cout << stack.top() << endl; stack.pop(); } cout << stack.to_string() << endl; } }