Hello
This code:
1 2 3 4
|
template <typename MyT>
inline void myFunc(MyT value) {
std::map<int, MyT>::iterator myIter;
}
|
gives this error:
error: expected `;' before "myIter"
but it compiles when I replace 'MyT' with 'int' in the third line, so I think the code is correct.
Can anyone tell me why the map won't accept template types?
Thanks.
Last edited on
That should work. What compiler are you using?
mingw32 with code::blocks
I've tryied in visual studio and it compiles indeed, but I need it for mingw, and R0mai's solution works, thanks a lot.