jeudi 26 mars 2015

Default values for bit fields in c++11

This works:



struct A {
unsigned int x = 0;
};


This also works:



struct A {
unsigned int x : 1;
};


Is it possible to combine the two? I.e., initialize and specify size simultaneously? Or do I need to explicitly write a constructor to do this?


Aucun commentaire:

Enregistrer un commentaire