hash_map对于自己定义的机构有限制吗?最大多少字节?
如题,还有下面这个程序问什么不通?也是关于hashmap的
#include "stdafx.h"
#include <fstream>
#include <stdio.h>
#include <string>
#include <hash_map>
using namespace std;
using namespace stdext;
typedef struct
{
char dip;
}flow4tuple;
struct greater_flow {
bool operator()( flow4tuple & x, flow4tuple & y) const{
if( x.sip>y.sip)
return false;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
hash_map< flow4tuple,int,hash_compare< flow4tuple,greater_flow> > iphash;
typedef pair < flow4tuple,int> flow4tuplepair;
hash_map< flow4tuple, int>::iterator hash1;
flow4tuple tempflow4tuple;
tempflow4tuple.dip=1;
iphash.insert(flow4tuplepair(tempflow4tuple,2));
if((hash1=iphash.find(tempflow4tuple))!=iphash.end())
printf("mlgb");
}