"filox" <fi*****************@yahoo.comwrote in message
news:ei**********@news1.carnet.hr...
>i just don't get it:
hash_map<double, intmapa;
double md = 0;
for(int j=0;j<1000000;++j)
{
mapa[md] = 3;
md++;
}
the above code takes up 70 MB of RAM. how??? any ideas?
You're storing one million items in a hash_map, which has significant
overhead (hash buckets and linked lists, etc), why are you surprised?
Because of the uncertain equality of floating-point numbers, using doubles
as hash_map keys has questionable utility.
>
--
You're never too young to have a Vietnam flashback