[SERVER-60031] RadixStore::radix_iterator [in]equality operators should be declared const Created: 16/Sep/21 Updated: 29/Oct/23 Resolved: 02/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Yuhong Zhang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Execution Team 2021-12-13 | ||||||||
| Participants: | |||||||||
| Description |
|
The RadixStore::radix_iterator class defines operator== and operator!= without declaring them const. When building in C++20 mode, clang-12 complains:
The iterator class should be re-worked to allow the [in]equality operators to be defined as const. In the meantime, we will suppress this warning. |
| Comments |
| Comment by Billy Donahue [ 07/Dec/21 ] |
|
This iterator needs to be refactored, and it sounds like this isn't news to anyone I just want to point out that in an a==b expression, the repositionIfChanged resync is only performed on a. |
| Comment by Githook User [ 04/Dec/21 ] |
|
Author: {'name': 'Yuhong Zhang', 'email': 'danielzhangyh@gmail.com', 'username': 'YuhongZhang98'}Message: |
| Comment by Githook User [ 02/Dec/21 ] |
|
Author: {'name': 'Yuhong Zhang', 'email': 'danielzhangyh@gmail.com', 'username': 'YuhongZhang98'}Message: |
| Comment by Connie Chen [ 01/Nov/21 ] |
|
Short term solution: make const and add mutable where needed. |