codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
// Size of SSO string: // http://gcc.gnu.org/onlinedocs/gcc-4.6.3/libstdc++/api/a01035_source.html // http://stackoverflow.com/questions/5419016/string-class-allocating-on-stack-for-small-strings #include <iostream> using namespace std; struct sso_string { enum { _S_local_capacity = 15 }; union { char _M_local_data[_S_local_capacity + 1]; unsigned _M_allocated_capacity; }; }; int main () { cout << sizeof (sso_string) << endl; return 0; }
Private
[
?
]
Run code
Submit