2020-07-28 11:42 AM
2020-07-28 02:35 PM
Is your code in C or C++? Ensure the compiler sees it as C++.
2020-07-29 12:49 AM
A class without a template pattern makes no problem, so it must be C++. Only a template <whatever> has a problem.
2020-07-29 06:43 AM
I'm aware you're trying to write C++ code. But if the file is named "something.c", the compiler will treat it as a C file.
If I use template within a C file, I get the exact error you've described:
...\printf.c:38:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
template <class T>
^
mingw32-make.exe[3]: ***