//below the code can be compiled ok in vc++8.0
#include"map"
#include<iostream>
using namespace std;
typedef struct {
long id;
char name[10];
} eleT;
struct lessval {
bool operator() (const eleT& s1, const eleT& s2) const {
return (s1.id < s2.id);
}
};
?
int main() {
_Tree< _Tmap_traits<eleT, eleT, lessval, std::allocator<eleT>, false> >
rb( lessval(), std::allocator<eleT>() );
//int sz=rb.size();
}
// but if I uncomment the line int sz=rb.size(), then I get the following error //message: left of '.size' must have class/struct/union . what was it ? how //does it be fixed ? thanks a lot.