In gcc I measured sizeof(std::stack<int>) and it show 80 bytes. Why it is so large?
It can contain pointer to the top and the size. Even if it contain also the pointer to the allocator, it should be not more than 20 bytes.
Another example, sizeof(std::set<int>) is 48 bytes.