Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Visual Studio 2010 standard library empty container sizes
- /*
- win32, release
- vector size:16
- map size:16
- string size:28
- hashtable size:44
- unordered_set size:44
- set size:16
- win32, debug
- vector size:20
- map size:20
- string size:32
- hashtable size:56
- unordered_set size:56
- set size:20
- */
- #include "stdafx.h"
- #include <vector>
- #include <map>
- #include <unordered_map>
- #include <unordered_set>
- #include <set>
- #include <iostream>
- int _tmain(int argc, _TCHAR* argv[])
- {
- std::cout << "vector size:"<<sizeof(std::vector<int>) << std::endl;
- std::cout << "map size:"<<sizeof(std::map<int,int>) << std::endl;
- std::cout << "string size:"<<sizeof(std::string) << std::endl;
- std::cout << "hashtable size:"<<sizeof(std::unordered_map<int,std::string>) << std::endl;
- std::cout << "unordered_set size:"<<sizeof(std::unordered_set<int>) << std::endl;
- std::cout << "set size:"<<sizeof(std::set<int>) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment