[SERVER-29360] Add operator<< to Date_t class Created: 24/May/17  Updated: 30/Oct/23  Resolved: 07/Jun/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Improvement Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Ted Tuckman
Resolution: Fixed Votes: 0
Labels: neweng, platforms-interns-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-29447 Transition away from Java-style `std:... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-06-19
Participants:

 Description   

This class has a toString() method, but in order to append it to a stream you need to call that manually. It would be nice to have operator<< for this class, which would make using it nicer, and would allow comparison of times within our unittest macros.



 Comments   
Comment by Githook User [ 07/Jun/17 ]

Author:

{u'name': u'Ted Tuckman', u'email': u'ted.tuckman@mongodb.com'}

Message: SERVER-29360 Add operator<< to Date_t class
Branch: master
https://github.com/mongodb/mongo/commit/cce6177e2b69a83ba94eab29084ce119197f2cb0

Comment by ADAM Martin (Inactive) [ 02/Jun/17 ]

Probably future work would be to invert the dependency between `Date_t::toString()` and `operator <<( std::ostream &, const Date_t & )` – this way we are not creating superfluous temporary strings each time we want to serialize this type to an output stream.

Generated at Thu Feb 08 04:20:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.