mercredi 1 novembre 2017

is there type trait that show if one type might contain value of other type

Is there some type trait that checks, if one integral type can hold value of other integral type without data loss?

For example int32_t might hold uint16_t, uint8_t, int32_t, int16_t and int8_t.

However int32_t can not hold uint32_t, nor uint64_t or int64_t.

Aucun commentaire:

Enregistrer un commentaire