prog.cpp:3:7: error: expected nested-name-specifier before ‘namepsace’
prog.cpp:3:7: error: ‘namepsace’ has not been declared
prog.cpp:3:17: error: expected ‘;’ before ‘std’
prog.cpp:3:17: error: ‘std’ does not name a type
prog.cpp: In function ‘int min(int*)’:
prog.cpp:8:36: error: there are no arguments to ‘min_element’ that depend on a template parameter, so a declaration of ‘min_element’ must be available [-fpermissive]
prog.cpp:8:36: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
prog.cpp: In function ‘int main()’:
prog.cpp:14:5: error: ‘cin’ was not declared in this scope
prog.cpp:14:5: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.7/iostream:61:18: note: ‘std::cin’
prog.cpp:20:5: error: ‘cout’ was not declared in this scope
prog.cpp:20:5: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.7/iostream:62:18: note: ‘std::cout’
prog.cpp:20:20: error: no matching function for call to ‘min(int [(((sizetype)(((ssizetype)n) + -1)) + 1)])’
prog.cpp:20:20: note: candidate is:
prog.cpp:6:5: note: template<int n> int min(int*)
prog.cpp:6:5: note: template argument deduction/substitution failed:
prog.cpp:20:20: note: couldn't deduce template parameter ‘n’
prog.cpp:21:16: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
prog.cpp:21:26: error: no matching function for call to ‘min(<brace-enclosed initializer list>)’
prog.cpp:21:26: note: candidate is:
prog.cpp:6:5: note: template<int n> int min(int*)
prog.cpp:6:5: note: template argument deduction/substitution failed:
prog.cpp:21:26: note: cannot convert ‘{2, 1, 3}’ (type ‘<brace-enclosed initializer list>’) to type ‘int*’