Boost C++ Libraries: Ticket #7232: boost::container::basic_string::insert's implementation is inconsistent with a document https://svn.boost.org/trac10/ticket/7232 <p> In boost::container::basic_string::insert, the function prototype is </p> <pre class="wiki"> void insert(const_iterator p, size_type n, CharT c); </pre><p> but the document has a return value description </p> <blockquote> <p> Returns: An iterator which refers to the copy of the first inserted character, or p if n == 0. </p> </blockquote> <p> Also </p> <pre class="wiki"> template&lt;typename InputIter&gt; void insert(const_iterator p, InputIter first, InputIter last); </pre><p> and </p> <blockquote> <p> Returns: An iterator which refers to the copy of the first inserted character, or p if first == last. </p> </blockquote> <p> I think these functions should return an iterator written in the document, like c++11. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7232 Trac 1.4.3 Ion Gaztañaga Wed, 15 Aug 2012 11:10:01 GMT <link>https://svn.boost.org/trac10/ticket/7232#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7232#comment:1</guid> <description> <p> Thanks for the report. In the standard these functions return void: </p> <p> <a class="ext-link" href="http://www.cplusplus.com/reference/string/string/insert/"><span class="icon">​</span>http://www.cplusplus.com/reference/string/string/insert/</a> </p> <p> So documentation should be corrected. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 15 Aug 2012 11:31:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7232#comment:2 https://svn.boost.org/trac10/ticket/7232#comment:2 <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> Fixed in trunk at revision: 80047 </p> Ticket Mitsuru Kariya <kariya_mitsuru@…> Wed, 15 Aug 2012 17:17:26 GMT <link>https://svn.boost.org/trac10/ticket/7232#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7232#comment:3</guid> <description> <p> Thanks for your reply. </p> <p> Until C++03 standard, these functions return void. But from C++11 standard, these functions were revised. </p> <p> <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#149"><span class="icon">​</span>http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#149</a> </p> <p> I think that basic_string (and other container in Boost.Container) would be better off returning an iterator for "C++11 Conformance". </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 15 Aug 2012 18:59:55 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/7232#comment:4 https://svn.boost.org/trac10/ticket/7232#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Thanks again, I see the change in N3776 from the pre-standard draft N3337. Reopened for future fix. </p> Ticket Ion Gaztañaga Thu, 10 Jan 2013 12:02:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7232#comment:5 https://svn.boost.org/trac10/ticket/7232#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> It was fixed in Boost 1.52. </p> Ticket