size_t in C++

Joined
May 9, 2010
Messages
1
Reaction score
0
Hello.

I've been scanning through the C++ standard, but could not find any information on this.

Is size_t always defined in terms of other "standard unsigned integer types", that is, always as a typedef of "unsigned int", "unsigned long", "unsigned long long", and so on--even if that typedef is just done internally?

Or is it possible for size_t to be able to represent more values than any other of the "standard unsigned integer types", say, 'unsigned long' in the current C++ standard, or 'unsigned long long' in C++0x? For example as a typedef of an "extended unsigned integer type" or simply by treating size_t not as a typedef, but as a standalone type which can have any bit size?

So, on a hypothetical 128-bit platform, could "unsigned long long" be just 64 bits, and size_t be 128 bits?

I'm not concerned about the practical usefulness, I'm just asking if the standard (the C++0x one) would allow that (which, I think ultimately depends on whether size_t is just a typedef, or a standalone type).

Thanks in advance for your help.

Kind regards,
Noah.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top