int sortStack(mystack s, mystack &t) { while(!s.empty()) { int tmp = s.top(); s.pop(); while(!t.empty() && t.top() > tmp) { s.push(t.top()); t.pop(); } t.push(tmp); } return 0; }
void fun1(mystack<std::function<bool()>>& stk, int const& n) { if (n<0) return; for (int itr = 0; itr<n; ++itr) { std::cout << "fun1: " + std::to_string(itr) << std::endl; stk.push(std::function<bool()>([itr, n](){return itr == n - 1; })); stk.emplace(std::function<bool()>([itr, n](){return false; })); } // à ce stade le .top() de stk va renvoyé ()->true }