Don't use const char* overload of operator<< (#1309)

This commit is contained in:
Victor Zverovich
2019-09-23 12:35:08 -07:00
parent 758446c80d
commit f29901097f
2 changed files with 17 additions and 5 deletions
+5 -5
View File
@@ -46,9 +46,9 @@ template <class Char> class formatbuf : public std::basic_streambuf<Char> {
template <typename Char> struct test_stream : std::basic_ostream<Char> {
private:
struct null;
// Hide all operator<< from std::basic_ostream<Char>.
void operator<<(null);
void_t<> operator<<(null<>);
void_t<> operator<<(const Char*);
};
// Checks if T has a user-defined operator<< (e.g. not a member of
@@ -56,9 +56,9 @@ template <typename Char> struct test_stream : std::basic_ostream<Char> {
template <typename T, typename Char> class is_streamable {
private:
template <typename U>
static decltype((void)(std::declval<test_stream<Char>&>()
<< std::declval<U>()),
std::true_type())
static bool_constant<!std::is_same<decltype(std::declval<test_stream<Char>&>()
<< std::declval<U>()),
void_t<>>::value>
test(int);
template <typename> static std::false_type test(...);