I'm using std::map, and can't understand how much memory it consumes.
I have the following map definitions:
CKey {
long x;
int y;
int z;
bool operator<(const CKey& l) const;
};
CValue {
int data1;
int data2;
}
std::map<CKey, CValue> map;
std::cout << "sizeof() = " << sizeof(map) << " Max #Elms = " << map.max_size();
(No mater before or after inserting elements into the map) I'm getting that.
sizeof() = 48
Max_Size = 329406144173384850
- If
sizeof(map) = 48
, how can it contains329406144173384850
elements ? - Does the map save the
<CKey,Cvalue>
in other memory (heap ?)