Opened 12 years ago
Closed 12 years ago
#4195 closed Bugs (fixed)
boost::circular_buffer documentation error
Reported by: | anonymous | Owned by: | Jan Gaspar |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | circular_buffer |
Version: | Boost 1.42.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
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.
Change History (4)
follow-up: 2 comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to nstewart@…:
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<T>::size.
Requesting clarification - can you be more specific?
The documentation gives the following example.
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);
The num_bytes implied to me that circular_buffer::array_one::second returns the number of bytes.
follow-up: 4 comment:3 by , 12 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Do you think this clarification would be the right solution?
write(file_desc, ar.first, ar.second)
->
write(file_desc, ar.first, ar.second*sizeof(circular_buffer<T>::value))
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to nstewart@…:
Do you think this clarification would be the right solution?
write(file_desc, ar.first, ar.second)
->
write(file_desc, ar.first, ar.second*sizeof(circular_buffer<T>::value))
Perfect.
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<T>::size.
Requesting clarification - can you be more specific?