Here's the class I'm working with (Some parts cut out)
const int records = 7;
class Timed {
public:
friend std::ostream& operator<<(std::ostream& os, Timed right) {
for (int i = 0; i < records; i++) {
os << right.eR[i].vName << " " << right.eR[i].duration << " " << right.eR[i].seconds << std::endl;
}
return os;
}
private:
std::chrono::time_point<std::chrono::steady_clock> start, end;
struct {
std::string vName;
std::string seconds;
std::chrono::duration<float> duration;
} eR[records];
};
Basically, I'm trying to output the values of the anonymous struct. However, I get the error:
binary '<<': no operator found which takes a right-hand operand of type 'std::chrono::duration<float,std::ratio>1,1>>' (or there is no acceptable conversion)
I was wondering how I would be able to print this value for duration? Thanks in advance