template parameter not recognise in typedef?
I am in the process of migrating a lib from VS6 to VS2005 and get a cryptic
syntax error.
#include "stdafx.h"
#include <set>
#include <map>
// using std::map; // uncommenting doesn't help
template <class EL_TYPE>
class mat
{
};
template <class EL_TYPE>
class thin_mat : public mat<EL_TYPE>
{
private:
typedef std::map<int,EL_TYPE> DATATYPE;
// if i change EL_TYPE to int, then no error below
// compiler doesn't complain about the typedef either way
typedef std::set<size_t> INDEXSET; //ok
typedef std::map<size_t,INDEXSET> INDEXSETMAP; //ok
enum
{
INDEXSETS_INSERT = 0x01,
INDEXSETS_REMOVE = 0x02
};
public:
typedef INDEXSET::iterator iteratorY; // ok
typedef DATATYPE::iterator iterator; // <<< here the compiler spits
typedef INDEXSET::iterator iteratorX; // ok
};
int _tmain(int argc, _TCHAR* argv[])
{
thin_mat<int> imat;
return 0;
}
Is this a compliance issue, where VS6 was too sloppy and compiled non-
standard code, or is it an issue in VS2005?
BTW: I tried renaming "DATATYPE" to "asdf", I tried using std::map -statement, I tried to rename iterator to myIter, all no good...
Any help is much appreciated.
Cheers,
D

