Boost C++ Libraries: Ticket #623: insignificant boost::array bug https://svn.boost.org/trac10/ticket/623 <pre class="wiki">A little thing I noticed when browsing the header array.hpp : static bool empty() { return false; } What if N is 0? Ok everything else then frequent however I'd suggest using static bool empty() { return N == 0; } as it is also likly to be evaluated at complietime and could perhaps avoid some subtil problems in meta programming. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/623 Trac 1.4.3 me22 Mon, 08 May 2006 22:58:49 GMT <link>https://svn.boost.org/trac10/ticket/623#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/623#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=509832 Have you tried making a boost::array with N==0? The language doesn't allow zero-length arrays, so it'll cause a compiler error. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>alisdairm27386</dc:creator> <pubDate>Sat, 03 Jun 2006 13:00:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/623#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/623#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=1392509 Standard Library TR1 required the array template to support arrays of length zero. A partial specialization will be added to the 1.34 release to support this case. Checking the sequence requirements I believe that empty should indeed return true for the case N == 0. (even though it is also 'full') </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 24 Jun 2006 11:20:18 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/623#comment:3 https://svn.boost.org/trac10/ticket/623#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=14804 There's a specialisation for the N==0 case now, so this should be fixed. Thanks, John. </pre> Ticket