[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: |
|
||||||||
| 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: |
| 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. |