PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

I want use std::map in my program, but have errors

i download STL for WinCE but it doesn't work
Code:
std::map<int,int> ma;
typedef std::map<int, int>::const_iterator CI;
for (CI p = ma.begin(); p != ma.end(); ++p)
{
}


give me
error C2678: binary '!=' : no operator defined which takes a left-hand operand of type 'struct std::_Rb_tree_iterator<struct std::pair<int const ,int>,struct std::pai
r<int const ,int> const &,struct std::pair<int const ,int> const *>' (or there is no acceptable conversion)
That code works well with the win32 compilers..

I don't know how old the eVC compiler is, but the stl lib is dated. Maybe you could give a different stl library a try? I've heared good things about stlport as an alternative.
That works on my installation if I take out that typedef, and gives the same error if I leave it as you have it.

This compiles:
Code:

std::map<int,int> ma;
std::map<int, int>::const_iterator p;
for (p = ma.begin(); p != ma.end(); ++p)
{
}