13.5 — Introduction to overloading the I/O operators
In the prior lesson (), we showed this example, where we used a function to convert an enumeration into an equivalent string: #include <iostream> #include <string_view> enum Color { black, red, blue, }; constexpr std::string_view getColorName(Color color) { switch (color) { case black: return “black”; case red: return “red”; case …