jeudi 24 mai 2018

Which section in the C++11 standard dictates the relative ordering between the sizes of primitive data types?

I am trying to find whether the C++ standard specifies the relationships between the size of various types. For example, this answer at https://stackoverflow.com/a/589599/1175080 seems claims:

sizeof(short int) <= sizeof(int) <= sizeof(long int)

Another answer at https://stackoverflow.com/a/589684/1175080 has a similar statement:

sizeof(int) <= sizeof(long)

I am going through n3337.pdf but I can't find the specific language that guarantees these inequalities.

Are these inequalities really defined in the C++ standard or are they directly inherited from C? Where is the language for this in the standard?

Aucun commentaire:

Enregistrer un commentaire