Does my overload of operator

I am legitimately intrigued why both the topic you linked, and
https://arne-mertz.de/2015/01/operator-overloading-common-practice/ or
many others never talk about a left operand from another type than
ostream.

Because it does not really matter. What works for std::ostream works similar for other types. Sorry, but its a bit like getting an example of overloading operator+ for a type Foo and then complaining that you never get an example of how to overload it for a Bar. If you want your type to offer a operator<< then yes, you implemented it in way that works.

Your code seems to be correct. Whether it does what you want, only you can decide.

Leave a Comment