I have the following toy code:
#include "date/date.h"
#include <iostream>
using namespace std;
using namespace chrono;
int main() {
cout << microseconds(100);
};
But, it doesn't work because:
C2679: binary '<<': no operator found which takes a right-hand operand of type 'std::chrono::milliseconds' (or there is no acceptable conversion)
But the docs for date.h list the specification:
template <class CharT, class Traits, class Rep, class Period>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os,
const std::chrono::duration<Rep, Period>& d);
which will use get_units to output appropriate units.
So, how can I properly use this overloaded << operator?