Test is_streamable with overloaded comma operators

This commit is contained in:
morinmorin 2019-02-06 19:45:14 +09:00 committed by Victor Zverovich
parent 430e6ac9b6
commit 9a0a24f90b

View File

@ -26,6 +26,11 @@ static std::wostream& operator<<(std::wostream& os, const Date& d) {
return os;
}
// Make sure that overloaded comma operators do no harm to is_streamable.
struct type_with_comma_op {};
template <typename T> void operator,(type_with_comma_op, const T&);
template <typename T> type_with_comma_op operator<<(T&, const Date&);
enum TestEnum {};
static std::ostream& operator<<(std::ostream& os, TestEnum) {
return os << "TestEnum";