[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:
Related
related to CXX-1553 Wrong ctor call to b_timestamp Closed
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 CXX-1553 for an example of the problem and discussion of the solution.



 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.

Generated at Wed Feb 07 22:03:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.