Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++11 status.

931. type traitextent<T, I>

Section: 21.3.6.4[meta.unary.prop]Status:C++11Submitter: Yechezkel MettOpened: 2008-11-04Last modified: 2016-01-28

Priority:Not Prioritized

View otheractive issues in [meta.unary.prop].

View all otherissues in [meta.unary.prop].

View all issues withC++11 status.

Discussion:

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

Table 44 -- Type property queries
TemplateValue
template <class T, unsigned I = 0> struct extent;IfT is not an array type (8.3.4), or if it has rank less thanI, or ifI is 0andT has type "array of unknown bound ofU", then 0; otherwise, thesize of theI'th dimension ofT

Firstly it isn't clear from the wording ifI is 0-based or 1-based ("theI'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 toI".

Sanity check:

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

Here the rank is 1 andI is 1, but the desired result is 0.

[Post Summit:]

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

Recommend Tentatively Ready.

Proposed resolution:

In Table 44 of 21.3.6.4[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;IfT is not an array type(8.3.4), or if it has rank less than or equal toI, or ifI is 0andT has type "array of unknown bound ofU", then 0; otherwise, thesizebound (8.3.4) of theI'th dimension ofT,where indexing ofI is zero-based.

[Wording supplied by Daniel.]


[8]ページ先頭

©2009-2026 Movatter.jp