Boost C++ Libraries: Ticket #4195: boost::circular_buffer documentation error https://svn.boost.org/trac10/ticket/4195 <p> The documentation for circular_buffer::array_one() implies that the second component of the array_range type refers to the number of bytes pointed to, while in fact it is the number of entries. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4195 Trac 1.4.3 nstewart@… Fri, 07 May 2010 15:09:43 GMT <link>https://svn.boost.org/trac10/ticket/4195#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4195#comment:1</guid> <description> <p> I don't see how the documentation implies bytes. In C++ it's normal for "size" to refer to the number of elements. Such as std::vector&lt;T&gt;::size. </p> <p> Requesting clarification - can you be more specific? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 19 May 2010 16:22:47 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4195#comment:2 https://svn.boost.org/trac10/ticket/4195#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">worksforme</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4195#comment:1" title="Comment 1">nstewart@…</a>: </p> <blockquote class="citation"> <p> I don't see how the documentation implies bytes. In C++ it's normal for "size" to refer to the number of elements. Such as std::vector&lt;T&gt;::size. </p> <p> Requesting clarification - can you be more specific? </p> </blockquote> <p> The documentation gives the following example. </p> <p> int write(int file_desc, char* buff, int num_bytes); array_range ar = buff.array_one(); write(file_desc, ar.first, ar.second); ar = buff.array_two(); write(file_desc, ar.first, ar.second); </p> <p> The num_bytes implied to me that circular_buffer::array_one::second returns the number of bytes. </p> Ticket nstewart@… Wed, 19 May 2010 16:42:01 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4195#comment:3 https://svn.boost.org/trac10/ticket/4195#comment:3 <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">worksforme</span> </li> </ul> <p> Do you think this clarification would be the right solution? </p> <p> write(file_desc, ar.first, ar.second) </p> <p> -&gt; </p> <p> write(file_desc, ar.first, ar.second*sizeof(circular_buffer&lt;T&gt;::value)) </p> Ticket anonymous Thu, 20 May 2010 03:09:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4195#comment:4 https://svn.boost.org/trac10/ticket/4195#comment:4 <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> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4195#comment:3" title="Comment 3">nstewart@…</a>: </p> <blockquote class="citation"> <p> Do you think this clarification would be the right solution? </p> <p> write(file_desc, ar.first, ar.second) </p> <p> -&gt; </p> <p> write(file_desc, ar.first, ar.second*sizeof(circular_buffer&lt;T&gt;::value)) </p> </blockquote> <p> Perfect. </p> Ticket