H
harsh.murari
I wanted to know how the C++ STL list is implemented. Specifically, I
wanted to understand the memory usage by the list objects.
I have the following code snippet:
std::list <int> L;
L.push_back(10);
L.push_back(20);
printf("List size %d\n", sizeof(L));
This is returning the object size of L to be 4 bytes. How is this
possible? What data members does the list object contain? Where are
previous pointer, next pointer etc stored? Any insights would be
appreciated.
wanted to understand the memory usage by the list objects.
I have the following code snippet:
std::list <int> L;
L.push_back(10);
L.push_back(20);
printf("List size %d\n", sizeof(L));
This is returning the object size of L to be 4 bytes. How is this
possible? What data members does the list object contain? Where are
previous pointer, next pointer etc stored? Any insights would be
appreciated.