Boost C++ Libraries: Ticket #3768: Incomplete documentation for type_traits::extent and type_traits::rank https://svn.boost.org/trac10/ticket/3768 <p> The documentation for type_traits::extent is: </p> <p> "Inherits: Class template extent inherits from integral_constant&lt;std::size_t, EXTENT(T,N)&gt;, where EXTENT(T,N) is the number of elements in the N'th array dimention of type T. </p> <p> If T is not an array type, or if N &gt; rank&lt;T&gt;::value, or if the N'th array bound is incomplete, then EXTENT(T,N) is zero." </p> <p> This does not explain what this type_traits is about. </p> <p> The documentation for type_traits::rank is: </p> <p> " Inherits: Class template rank inherits from integral_constant&lt;std::size_t, RANK(T)&gt;, where RANK(T) is the number of array dimensions in type T. </p> <p> If T is not an array type, then RANK(T) is zero. " </p> <p> This does not explain what this type_traits is about. </p> <p> Decent documentation for both of these would be welcome. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3768 Trac 1.4.3 anonymous Tue, 15 Dec 2009 10:10:59 GMT <link>https://svn.boost.org/trac10/ticket/3768#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3768#comment:1</guid> <description> <p> So what would you suggest? </p> <blockquote class="citation"> <p> Inherits: Class template extent inherits from integral_constant&lt;std::size_t, &gt;EXTENT(T,N)&gt;, where EXTENT(T,N) is the number of elements in the N'th array dimention &gt;of type T. If T is not an array type, or if N &gt; rank&lt;T&gt;::value, or if the N'th array bound is &gt;incomplete, then EXTENT(T,N) is zero." </p> <p> This does not explain what this type_traits is about. </p> </blockquote> <p> Really? Concise maybe, but how does "where EXTENT(T,N) is the number of elements in the N'th array dimention of type T" not precisely describe the traits behaviour? </p> <p> John. </p> </description> <category>Ticket</category> </item> <item> <author>Edward Diener <eld@…></author> <pubDate>Wed, 16 Dec 2009 01:36:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3768#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3768#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3768#comment:1" title="Comment 1">anonymous</a>: </p> <blockquote class="citation"> <p> So what would you suggest? </p> <blockquote class="citation"> <p> Inherits: Class template extent inherits from integral_constant&lt;std::size_t, &gt;EXTENT(T,N)&gt;, where EXTENT(T,N) is the number of elements in the N'th array dimention &gt;of type T. If T is not an array type, or if N &gt; rank&lt;T&gt;::value, or if the N'th array bound is &gt;incomplete, then EXTENT(T,N) is zero." </p> <p> This does not explain what this type_traits is about. </p> </blockquote> <p> Really? Concise maybe, but how does "where EXTENT(T,N) is the number of elements in the N'th array dimention of type T" not precisely describe the traits behaviour? </p> <p> John. </p> </blockquote> <p> I know it is said that: </p> <p> 'EXTENT(T,N) is the number of elements in the N'th array dimention of type T' </p> <p> but I am not really sure what this means ( forget the misspelling of 'dimention', I know it is really 'dimension' ). Does this mean that T must be a C-style array ? If T must be a C-style array, does this mean that if T is, for example 'int <a class="changeset" href="https://svn.boost.org/trac10/changeset/4" title="Tweak disclaimer formatting, again">[4]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/7" title="Initial content for next-gen Boost website. ">[7]</a>' that EXTENT(T,1) is 7 ? Or is there something else in both these assumptions. </p> <p> Perhaps the problem is mine and I am looking into the words 'array' and 'dimension' for something that is not there. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 04 Feb 2010 17:11:56 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3768#comment:3 https://svn.boost.org/trac10/ticket/3768#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59472" title="Clarify docs and add some more examples. Fixes #3768.">[59472]</a>) Clarify docs and add some more examples. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3768" title="#3768: Bugs: Incomplete documentation for type_traits::extent and type_traits::rank (closed: fixed)">#3768</a>. </p> Ticket