full() returns false even if the circular buffer is full
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the boost::circular_buffer constructor, set_capacity(), push_back(), size(), capacity(), and full() entry points, and reproduce the reported sequence of 1,000 insertions after setting capacity to 100. Compare the observed size and full() result with the circular buffer's documented capacity semantics; done means determining whether this is a library defect or an incorrect expectation and documenting or testing the conclusion.
Written by the indexing model from the issue text.
Description
Hi,
I have created a boost::circular_buffer<my_class_type> using the default ctor.
Then I call set_capacity(100) and then I push_back() a thousand elements: the size() of the circular buffer is reported as 99 and thus the function full() always return false.
I think this is very misleading: my belief is that instead of having:
bool full() const BOOST_NOEXCEPT { return capacity() == size(); }
we should have:
bool full() const BOOST_NOEXCEPT { return capacity()-1 == size(); }
What am I missing?
Thanks,
Francesco
- Dominant language
- C++
- Stars
- 65
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/circular_buffer
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
boostorg/circular_buffer#53 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
boostorg/circular_buffer#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
boostorg/circular_buffer#48 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
boostorg/circular_buffer#47 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
boostorg/circular_buffer#46 · 4 comments ·
All issues in boostorg/circular_buffer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ros2/message_filters#338 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
subsurface/subsurface#4984 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·