Created on 2010-08-02.00:00:00 last changed 96 months ago
[Voted into the WP at the November, 2010 meeting.]
Proposed resolution (September, 2010):
Add the following three paragraphs after 17.2 [support.types] paragraph 4:
The type ptrdiff_t is an implementation-defined signed integer type that can hold the difference of two subscripts in an array object, as described in 7.6.6 [expr.add].
The type size_t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object.
[Note: It is recommended that implementations choose types for ptrdiff_t and size_t whose integer conversion ranks (7.3.15 [conv.bool]) are no greater than that of signed long int unless a larger size is necessary to contain all the possible values. —end note]
The return type of the sizeof operator is defined as being of type std::size_t, defined in library clause 17.2 [support.types]. This, in turn, says that size_t is defined in the C standard, which in turn says that size_t is defined as the type of the result of the sizeof operator!
The C definition of sizeof returns an implementation-defined unsigned integer type, recommended not to have “an integer conversion rank greater than signed long int, unless the implementation supports objects large enough to make this necessary.”
|2014-03-03 00:00:00||admin||set||status: fdis -> c++11|
|2011-04-10 00:00:00||admin||set||status: dr -> fdis|
|2010-11-29 00:00:00||admin||set||messages: + msg3157|
|2010-11-29 00:00:00||admin||set||status: tentatively ready -> dr|
|2010-10-18 00:00:00||admin||set||messages: + msg2977|
|2010-10-18 00:00:00||admin||set||status: drafting -> tentatively ready|