In my code, I have the following struct :
struct foo { int a; int b; };
Only values ββfrom 0 to 100 are stored in b In general, I could replace it with char . But the size of the struct same due to padding effects. Since my code contains vectors and sets this structure with several million entries, this will reduce memory usage by more than one third if I somehow get around the add-on. Is there any way to do this, for example. Is there any other (optional) data container that behaves in the same way?
Edit: I use both GNU and Intel compiler on Linux systems:
source share