Boost C++ Libraries: Ticket #3168: Request for boost::array::fill(const T&), following C++0x https://svn.boost.org/trac10/ticket/3168 <p> According to the latest C++0x Working Draft, <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2857.pdf"><span class="icon">​</span>N2857</a>, std::array will have a member function named <em>fill</em>. </p> <p> Quoting 23.3.1.5 array::fill [array.fill]: </p> <pre class="wiki">requires CopyAssignable&lt;T&gt; void fill(const T&amp; u); 1 Effects: fill_n(begin(), N, u) </pre><p> Even while using a compiler that does not support C++0x concepts, I think it's desirable to have this function added to boost::array already. E.g., as follows: </p> <pre class="wiki"> void fill(const T&amp; value) { std::fill_n(elems, N, value); } </pre><p> Of course, it is effectively the same as boost::array::assign. Maybe boost::array::assign should become deprecated. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3168 Trac 1.4.3 niels_dekker Fri, 12 Jun 2009 21:41:00 GMT <link>https://svn.boost.org/trac10/ticket/3168#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3168#comment:1</guid> <description> Related LWG issue (defect): <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776"> 776. Undescribed assign function of std::array</a>, submitted by Daniel Krügler </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 14 Jun 2009 13:53:12 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/3168#comment:2 https://svn.boost.org/trac10/ticket/3168#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Steven Watanabe</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket niels_dekker Sun, 14 Jun 2009 19:20:26 GMT <link>https://svn.boost.org/trac10/ticket/3168#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3168#comment:3</guid> <description> <p> Thanks for assigning the ticket, Steven. Clearly, the intention of the ticket is to keep <em>boost::array</em> in sync with <em>std::array</em> from C++0x. Only after submitting the ticket, I realized that none of the other STL containers has a <em>fill</em> member function. And it isn't really clear to me why <em>std::array</em> has one. (I might as well use the range-based <em>fill</em> algorithm instead.) What do you think? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Thu, 20 Aug 2009 13:28:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3168#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3168#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3168#comment:3" title="Comment 3">niels_dekker</a>: </p> <blockquote class="citation"> <p> Thanks for assigning the ticket, Steven. Clearly, the intention of the ticket is to keep <em>boost::array</em> in sync with <em>std::array</em> from C++0x. Only after submitting the ticket, I realized that none of the other STL containers has a <em>fill</em> member function. And it isn't really clear to me why <em>std::array</em> has one. (I might as well use the range-based <em>fill</em> algorithm instead.) What do you think? </p> </blockquote> <p> On the other hand, the other standard containers have a </p> <pre class="wiki">void assign(size_type n, const T&amp; u); </pre><p> fill is the equivalent for array since the size of an array is fixed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 10 Mar 2010 18:05:46 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/3168#comment:5 https://svn.boost.org/trac10/ticket/3168#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Steven Watanabe</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> <p> Added in revision 60436. Will migrate to release before 1.43 </p> Ticket Marshall Clow Thu, 25 Mar 2010 15:57:49 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3168#comment:6 https://svn.boost.org/trac10/ticket/3168#comment:6 <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> Migrated to release branch in revision 60824 </p> Ticket