1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <vector> #include <string> #include <algorithm> std::string f(const std::vector<int>& input) { std::sort(input.begin(), input.end()); } int main() { std::vector test = [3, 5, 2, 4, 1]; f(*test); cout << test; {
1 2 3
In function 'int main()': Line 12: error: missing template arguments before 'test' compilation terminated due to -Wfatal-errors.