foo.cc: In function 'int main()':
foo.cc:11:46: error: wrong number of template arguments (0, should be 1)
priority_queue<int, vector<int>, greater<> > queue1;
^
In file included from /usr/include/c++/7/string:48:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from foo.cc:1:
/usr/include/c++/7/bits/stl_function.h:371:12: note: provided for 'template<class _Tp> struct std::greater'
struct greater : public binary_function<_Tp, _Tp, bool>
^~~~~~~
foo.cc:11:48: error: template argument 3 is invalid
priority_queue<int, vector<int>, greater<> > queue1;
^
foo.cc:14:16: error: request for member 'push' in 'queue1', which is of non-class type 'int'
queue1.push(temp);
^~~~
foo.cc:16:19: error: request for member 'size' in 'queue1', which is of non-class type 'int'
while (queue1.size() > 1) {
^~~~
foo.cc:17:24: error: request for member 'top' in 'queue1', which is of non-class type 'int'
int a = queue1.top();
^~~
foo.cc:18:16: error: request for member 'pop' in 'queue1', which is of non-class type 'int'
queue1.pop();
^~~
foo.cc:19:24: error: request for member 'top' in 'queue1', which is of non-class type 'int'
int b = queue1.top();
^~~
foo.cc:20:16: error: request for member 'pop' in 'queue1', which is of non-class type 'int'
queue1.pop();
^~~
foo.cc:22:16: error: request for member 'push' in 'queue1', which is of non-class type 'int'
queue1.push(a + b);
^~~~