/in/foo.cc:6:10: error: 'Peak' was not declared in this scope
bool cmp(Peak a, Peak b)
^~~~
/in/foo.cc:6:18: error: 'Peak' was not declared in this scope
bool cmp(Peak a, Peak b)
^~~~
/in/foo.cc:6:24: error: expression list treated as compound expression in initializer [-fpermissive]
bool cmp(Peak a, Peak b)
^
/in/foo.cc: In function 'int main()':
/in/foo.cc:15:17: error: 'Peak' was not declared in this scope
std::vector<Peak> peaks;
^~~~
/in/foo.cc:15:21: error: template argument 1 is invalid
std::vector<Peak> peaks;
^
/in/foo.cc:15:21: error: template argument 2 is invalid
/in/foo.cc:21:15: error: request for member 'push_back' in 'peaks', which is of non-class type 'int'
peaks.push_back(Peak{x, y, h});
^~~~~~~~~
/in/foo.cc:21:29: error: expected ')' before '{' token
peaks.push_back(Peak{x, y, h});
^
/in/foo.cc:24:5: error: 'sort' is not a member of 'std'
std::sort(peaks.begin(), peaks.end(), cmp);
^~~
/in/foo.cc:24:21: error: request for member 'begin' in 'peaks', which is of non-class type 'int'
std::sort(peaks.begin(), peaks.end(), cmp);
^~~~~
/in/foo.cc:24:36: error: request for member 'end' in 'peaks', which is of non-class type 'int'
std::sort(peaks.begin(), peaks.end(), cmp);
^~~
/in/foo.cc:31:20: error: invalid types 'int[int]' for array subscript
if (peaks[i].h > peaks.h)
^
/in/foo.cc:31:32: error: request for member 'h' in 'peaks', which is of non-class type 'int'
if (peaks[i].h > peaks.h)
^
/in/foo.cc:37:9: error: 'st' was not declared in this scope
st.push(peaks[i]);
^~
/in/foo.cc:37:24: error: invalid types 'int[int]' for array subscript
st.push(peaks[i]);
^