c++11 - Does the C++ standard guarantee that std::uintmax_t can hold all values of std::size_t? -


does c++ standard guarantee (either explicitly stating or implicitly logical deduction) std::uintmax_t can hold values of std::size_t?

or possible std::numeric_limits<std::size_t>::max() larger std::numeric_limits<std::uintmax_t>::max()?

yes.

size_t defined unsigned integer type large enough contain size of object. uintmax_t defined able store value of unsigned integer type. if size_t can store it, uintmax_t can store it.

definition of size_t c++11 §18.2:

the type size_t implementation-defined unsigned integer type large enough contain size in bytes of object.

definition of uintmax_t c99 §7.18.1.5 (it included in c++ normative reference):

the following type designates unsigned integer type capable of representing value of unsigned integer type:

uintmax_t 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -