Protect against overloaded comma operators in decltype

This commit is contained in:
morinmorin
2019-02-06 15:44:59 -08:00
committed by Victor Zverovich
parent 467520e7a4
commit 430e6ac9b6
3 changed files with 12 additions and 9 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ template <typename Char> struct test_stream : std::basic_ostream<Char> {
template <typename T, typename Char> class is_streamable {
private:
template <typename U>
static decltype(internal::declval<test_stream<Char>&>()
<< internal::declval<U>(),
static decltype((void)(internal::declval<test_stream<Char>&>()
<< internal::declval<U>()),
std::true_type())
test(int);