I just learned about padding, and I was trying to do some tests about it, I tried to pack this struct :
struct B {
int a,b,c;
string s;
char x;
string t;
char y;
string u;
}__attribute__((packed)) ;
But I get this Warning :
warning: ignoring packed attribute because of unpacked non-POD field 'std::string B::u'
string u;
Does this mean that structs containing strings
cannot be packed ? Is there any other way to do it ? if so does it affect the performance ?