The code fail at compilation line
map_free_segments [ loc ] = color;
The first line for the errors is :
error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::vector<_Ty,_Alloc> &' from 'const localization'
The complete source :
#include <windows.h>
#include <hash_map>
using namespace std;
using namespace stdext;
#pragma pack(1)
struct localization
{
char X;
char Y;
char Z;
char L;
};
#pragma pack(1)
typedef hash_map<localization,unsigned long> type_map_free_segments;
//typedef pair<localization, unsigned long> pair_loc;
int main(int argc, CHAR* argv[])
{
unsigned long color = 1234;
type_map_free_segments map_free_segments;
localization loc;
loc.X = 1;
loc.Y = 2;
loc.Z = 3;
loc.L = 5;
map_free_segments [ loc ] = color;
//map_free_segments.insert( pair_loc(loc, color ));
return 0;
}