Make ostream operators opt in to reduce the risk of ODR violations

This commit is contained in:
Victor Zverovich
2022-02-04 15:06:45 -08:00
parent 8a21e328b8
commit f055ebbd25
5 changed files with 35 additions and 43 deletions
+6
View File
@@ -220,6 +220,12 @@ std::wostream& operator<<(std::wostream& os, streamable_enum) {
return os << L"streamable_enum";
}
namespace fmt {
template <>
struct formatter<streamable_enum, wchar_t>
: ostream_formatter<streamable_enum, wchar_t> {};
} // namespace fmt
enum unstreamable_enum {};
TEST(xchar_test, enum) {