[CXX-1555] Reimplement b_timestamp type with timestamp, increment in natural order Created: 17/Apr/18 Updated: 08/Feb/23 |
|
| Status: | Backlog |
| Project: | C++ Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | CXX ABI | ||||||||
| Quarter: | FY24Q1 | ||||||||
| Description |
|
The b_timestamp type has public fields increment, timestamp, declared in the reverse order from the order that's widespread and natural: "timestamp, increment." This makes the driver itself and applications that use it error-prone. See |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 17/Apr/18 ] |
|
Another thing to note is that since the two types for the fields are identical, you can easily pass them in the wrong order with initialization syntax. We should instead give this type a proper constructor that flows one of the values through std::chrono::duration. |