following tables are results of sizeof().
Win32
| VC2003 - VC2013 debug/release |
char | 1 |
unsigned char | 1 |
short | 2 |
unsigned short | 2 |
int | 4 |
unsigned int | 4 |
long | 4 |
unsigned long | 4 |
float | 4 |
double | 8 |
wchar_t | 2 |
| VC2003 debug | VC2008 debug | VC2010 debug | VC2012, VC2013 debug | VC2003 release | VC2008 release | VC2010 release | VC2012, VC2013 release |
std::string | 28 | 32 | 32 | 28 | 28 | 28 | 28 | 24 |
std::wstring | 28 | 32 | 32 | 28 | 28 | 28 | 28 | 24 |
std::valarray<int> | 12 | 12 | 8 | 8 | 12 | 12 | 8 | 8 |
std::vector<int> | 16 | 20 | 20 | 16 | 16 | 24 | 16 | 12 |
std::list<int> | 12 | 24 | 16 | 12 | 12 | 28 | 12 | 8 |
std::set<int> | 12 | 28 | 20 | 12 | 12 | 32 | 16 | 8 |
std::map<int, int> | 12 | 28 | 20 | 12 | 12 | 32 | 16 | 8 |
std::pair<int, int> | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
std::tuple<int> | | | | 4 | | | | 4 |
std::function<void(void)> | | | 24 | 24 | | | 24 | 24 |
std::iostream | 64 | 64 | 96 | 104 | 64 | 64 | 96 | 104 |
std::wiostream | 64 | 64 | 96 | 104 | 64 | 64 | 96 | 104 |
x64
| VC2008 - VC2013 release/debug | g++ 4.4.7 4.7.2 |
char | 1 | 1 |
unsigned char | 1 | 1 |
short | 2 | 2 |
unsigned short | 2 | 2 |
int | 4 | 4 |
unsigned int | 4 | 4 |
long | 4 | 8 |
unsigned long | 4 | 8 |
float | 4 | 4 |
double | 8 | 8 |
wchar_t | 2 | 4 |
| VC2008 debug | VC2010 debug | VC2012, VC2013 debug | VC2008 release | VC2010 release | VC2012, VC2013 release |
std::string | 48 | 48 | 40 | 40 | 40 | 32 |
std::wstring | 48 | 48 | 40 | 40 | 40 | 32 |
std::valarray<int> | 24 | 16 | 16 | 24 | 16 | 16 |
std::vector<int> | 40 | 40 | 32 | 48 | 32 | 24 |
std::list<int> | 48 | 32 | 24 | 56 | 24 | 16 |
std::set<int> | 56 | 40 | 24 | 64 | 32 | 16 |
std::map<int, int> | 56 | 40 | 24 | 64 | 32 | 16 |
std::pair<int, int> | 8 | 8 | 8 | 8 | 8 | 8 |
std::tuple<int> | | | 4 | | | 4 |
std::function<void(void)> | | 32 | 32 | | 32 | 32 |
std::iostream | 120 | 120 | 128 | 120 | 120 | 128 |
std::wiostream | 120 | 120 | 128 | 120 | 120 | 128 |
| g++ 4.4.7 4.7.2 |
std::string | 8 |
std::wstring | 8 |
std::valarray<int> | 16 |
std::vector<int> | 24 |
std::list<int> | 16 |
std::set<int> | 48 |
std::map<int, int> | 48 |
std::pair<int, int> | 8 |
std::tuple<int> | 4 |
std::function<void(void)> | 32 |
std::iostream | 288 |
std::wiostream | 288 |