Is the following code well-formed program per the standard?
std::ostream& operator<<(std::ostream& out, std::chrono::system_clock::time_point tp)
{
return out << tp.time_since_epoch().count();
}
This isn't a template defined in the standard library, and isn't defined inside the namespace std, so it seems to be well-formed, but I might me missing something.
I don't see anything in the section named Constraints on programs that forbids defining a function like yours.
I say, it is perfectly valid to do so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With