Opened 10 years ago
Last modified 9 years ago
#8012 new Bugs
Inconsistency in linearize()
Reported by: | Owned by: | No-Maintainer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | circular_buffer |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | linearize empty | Cc: |
Description
Assume two equivalent non-empty circular buffers A and B, with A reporting as linearized and B as not linearized. After calling clear() on them, they will both still report the same linearized state as before; the linearized state applies to all buffers, whether empty or not. However, calling linearize() on the non-linearized empty buffer B will not linearize it, which is inconsistent.
One option to fix this would be to automatically linearize a buffer when it becomes empty, but that would force some overhead even in cases where it is unnecessary. A better solution would be to make linearize() work normally even on empty buffers.