lundi 20 juillet 2015

Can cstdint typedefs bind to some implementation specific types std::numeric_limits is not specialized for?

Is it possible, at least theoretically, that cstdint typedefs bind to some implementation specific types std::numeric_limits is not specialized for?

According http://ift.tt/1KhrKXw , let me quote, "[std::numeric_limits] is specialized for every fundamental arithmetic type, with its members describing the properties of type T. This template shall not be specialized for any other type."

According to http://ift.tt/1gKI1dC , let me quote again, "implementations may provide specializations of std::numeric_limits for implementation-specific types".

"May", cppreference says. So they don't have to.

And finally, according to http://ift.tt/1niiMBR , the typedefs defined in the header "are typedefs of fundamental integral types or extended integral types".

So, to sum up - it seems that cstdint typedefs might bind to extended integral types (whatever they are), which are not fundamental integral types (again, whatever they are), and therefore might be incompatible with std::numeric_limits . Is this correct?

However, the documentations I linked to seem to be slightly inconsistent on one point. Isn't cplusplus.com's prohibition that std::numeric_limits must not be specialized for any non-fundamental arithmetic type in opposition of cppreference's allowance that std::numeric_limits might be specialized for implementation-specific types? Unless, of course, these implementation-specific types actually are fundamental integral types, in which case, hopefully, std::numeric_limits would have to be specialized for all cstdint typedefs.

The documentations confuse me. So I ask my question here :)

Aucun commentaire:

Enregistrer un commentaire