Title
type trait extent<T, I>
Status
c++11
Section
[meta.unary.prop]
Submitter
Yechezkel Mett

Created on 2008-11-04.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

[ Wording supplied by Daniel. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

In Table 44 of [meta.unary.prop], third row, column "Value", change the cell content:

Table 44 -- Type property queries
TemplateValue
template <class T, unsigned I = 0> struct extent; If T is not an array type (8.3.4), or if it has rank less than or equal to I, or if I is 0 and T has type "array of unknown bound of U", then 0; otherwise, the size bound (8.3.4) of the I'th dimension of T, where indexing of I is zero-based.
Date: 2010-10-21.18:28:33

[ Post Summit: ]

Do not use "size" or "value", use "bound". Also, move the cross-reference to 8.3.4 to just after "bound".

Recommend Tentatively Ready.

Date: 2008-11-04.00:00:00

The draft (N2798) says in [meta.unary.prop] Table 44:

Table 44 -- Type property queries
TemplateValue
template <class T, unsigned I = 0> struct extent; If T is not an array type (8.3.4), or if it has rank less than I, or if I is 0 and T has type "array of unknown bound of U", then 0; otherwise, the size of the I'th dimension of T

Firstly it isn't clear from the wording if I is 0-based or 1-based ("the I'th dimension" sort of implies 1-based). From the following example it is clear that the intent is 0-based, in which case it should say "or if it has rank less than or equal to I".

Sanity check:

The example says assert((extent<int[2], 1>::value) == 0);

Here the rank is 1 and I is 1, but the desired result is 0.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4428
2010-10-21 18:28:33adminsetmessages: + msg4427
2010-10-21 18:28:33adminsetmessages: + msg4426
2008-11-04 00:00:00admincreate