[CXX-626] Provide support to construct b_date from std::chrono::time_point Created: 08/Jul/15  Updated: 11/Jan/16  Resolved: 08/Oct/15

Status: Closed
Project: C++ Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 3.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Epic Link: C++11 Driver MongoDB 3.2

 Description   

See TODO in create.cpp



 Comments   
Comment by Adam Midvidy [ 08/Oct/15 ]

Thanks again oferei!!

Comment by Githook User [ 08/Oct/15 ]

Author:

{u'username': u'oferei', u'name': u'Ofer Reichman', u'email': u'oferei@gmail.com'}

Message: CXX-626: Added conversion between b_date and std::chrono::system_clock::time_point.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/718fcb4190894a45b8b9124e54c762ba3d3b9be3

Comment by Ofer Reichman [ 08/Oct/15 ]

Ok, see pull request 322.
1. added constructor from std::chrono::system_clock::time_point.
2. added cast operator to std::chrono::system_clock::time_point.
3. added a couple of tests.

I'm new to the project, so please review code and test.
notice that I added support for only system_clock::time_point - not any time_point. I think it should be enough.

Comment by Adam Midvidy [ 08/Oct/15 ]

https://github.com/mongodb/mongo-cxx-driver/pull/322

Comment by Adam Midvidy [ 07/Oct/15 ]

Ofer, I think that looks basically correct. The main verification would be to write a test converting a time_point to a b_date and back and checking that the two time_points match.

Comment by Ofer Reichman [ 29/Sep/15 ]

Does this method seem correct?
https://groups.google.com/d/msg/mongodb-user/kHSRXx1SiMA/0B6BITAmAgAJ

Generated at Wed Feb 07 21:59:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.