I had a
HashMap<Node, Double>
in Java which I'd use later on to retrieve the double associated with a node. I've tried to do
boost::unordered_map<Node*, double>
but I get a "error C2108: subscript is not of integral type" when I try to put something in it, like:
map[some_node] = some_double;
If I interpreted the error right, then I have to replace my double with an int. Is there a simple way around this?
okay, here's the function then:
void myClass::someFunction(const double* r)
{
//map is boost::unordered_map<Node*, double>
//nodes is a pointer to std::vector<Node*>
std::vector<Node*>::iterator it;
for(it = nodes->begin(); it != nodes->end(); it++)
{
//calculate the index
map[*it] = r[index]; //error
}
}