[CXX-560] mongo::OID::asTimeT() and mongo::OID::asDateT() should be const Created: 15/Mar/15  Updated: 06/Dec/16  Resolved: 16/Mar/15

Status: Closed
Project: C++ Driver
Component/s: API, Performance
Affects Version/s: legacy-1.0.0
Fix Version/s: legacy-1.0.1

Type: Bug Priority: Major - P3
Reporter: Peng Xie Assignee: Unassigned
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-17596 mongo::OID::asTimeT() and mongo::OID:... Closed

 Description   

As mongo::OID::asDateT() calls mongo::OID::asTimeT(), which calls OID::getTimestamp(), which is a const member function, mongo::OID::asDateT() and mongo::OID::asTimeT() should also be marked as const.



 Comments   
Comment by Githook User [ 16/Mar/15 ]

Author:

{u'username': u'mapx', u'name': u'yuchen.xie', u'email': u'yuchen.xie@live.com'}

Message: CXX-560 Mark mongo::OID::asTimeT() and mongo::OID::asDateT() const
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/624146feb3bb74fe139b167af02d666e83f24e7d

Comment by Peng Xie [ 16/Mar/15 ]

Hi Adam, I did what you told me to do. That's very insteresting!

Thanks!

Comment by Adam Midvidy [ 15/Mar/15 ]

Hey Yuchen. I agree that these member functions should be marked const. I will merge this PR tomorrow. If you'd like, you can also open the same PR on the mongodb/mongo project, and then file a ticket on the SERVER project - as this code is the same in the MongoDB server! For that you will need to sign a contributors agreement: https://www.mongodb.com/legal/contributor-agreement.

Thanks again for contributing!

Adam

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