souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:11:5: error: 'function' was not declared in this scope
11 | function<void()> generate = [&]() {
| ^~~~~~~~
souvenirs.cpp:4:1: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
3 | #include <algorithm>
+++ |+#include <functional>
4 | using namespace std;
souvenirs.cpp: In lambda function:
souvenirs.cpp:19:21: error: no matching function for call to 'generate()'
19 | generate();
| ~~~~~~~~^~
In file included from /usr/include/c++/13/algorithm:61,
from souvenirs.cpp:3:
/usr/include/c++/13/bits/stl_algo.h:4434:5: note: candidate: 'template<class _FIter, class _Generator> constexpr void std::generate(_FIter, _FIter, _Generator)'
4434 | generate(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:4434:5: note: template argument deduction/substitution failed:
souvenirs.cpp:19:21: note: candidate expects 3 arguments, 0 provided
19 | generate();
| ~~~~~~~~^~
In file included from /usr/include/c++/13/algorithm:73:
/usr/include/c++/13/pstl/glue_algorithm_defs.h:200:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Generator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator)'
200 | generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g);
| ^~~~~~~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:200:1: note: template argument deduction/substitution failed:
souvenirs.cpp:19:21: note: candidate expects 4 arguments, 0 provided
19 | generate();
| ~~~~~~~~^~
souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:23:13: error: no matching function for call to 'generate()'
23 | generate();
| ~~~~~~~~^~
/usr/include/c++/13/bits/stl_algo.h:4434:5: note: candidate: 'template<class _FIter, class _Generator> constexpr void std::generate(_FIter, _FIter, _Generator)'
4434 | generate(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:4434:5: note: template argument deduction/substitution failed:
souvenirs.cpp:23:13: note: candidate expects 3 arguments, 0 provided
23 | generate();
| ~~~~~~~~^~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:200:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Generator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator)'
200 | generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g);
| ^~~~~~~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:200:1: note: template argument deduction/substitution failed:
souvenirs.cpp:23:13: note: candidate expects 4 arguments, 0 provided
23 | generate();
| ~~~~~~~~^~