template compilation error
I am getting compilation error on following peice of code:
[code]
template <typename KEY>
class XYZ
{
private:
map<KEY,int> m_Map;
typedef map<KEY,int>::iterator it;
............................
}
[/code]
Error: No parameters provided for template.
I have CC version Sun C++ 5.5
[375 byte] By [
DevendraCa] at [2007-11-27 5:28:05]

# 1
Following code is compiled successfully. I added 'typename' keyword. Without this keyword compiler shows warning but produces correct code. Have you installed the latest patch for your compiler?
% cat test.cc
#include <map>
using namespace std;
template <typename KEY>
class XYZ
{
private:
map<KEY,int> m_Map;
typedef typename map<KEY,int>::iterator it;
};
XYZ<int> s;
% CC -V -c test.cc
CC: Sun C++ 5.5 Patch 113817-19 2006/10/13
ccfe: Sun C++ 5.5 Patch 113817-19 2006/10/13