From bfa14a673eabd3a3f17d68843a634703c821df9c Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 6 Oct 2016 19:42:38 +0200 Subject: [PATCH] common: Work around SFINAE issues in MSVC MSVC 2015 still has... issues with SFINAE, so the usual way to use std::enable_if doesn't compile. So let's try and SFINAE this in a different way until MS fixes their compiler. --- src/common/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/types.h b/src/common/types.h index 34a5fb1e..eb0c0ca2 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -115,7 +115,7 @@ typedef QList BufferIdList; * @returns A reference to the stream */ template{}, int>::type = 0> + typename = typename std::enable_if::value>::type> QDataStream &operator<<(QDataStream &out, T value) { out << static_cast::type>(value); return out; @@ -129,7 +129,7 @@ QDataStream &operator<<(QDataStream &out, T value) { * @returns A reference to the stream */ template{}, int>::type = 0> + typename = typename std::enable_if::value>::type> QDataStream &operator>>(QDataStream &in, T &value) { typename std::underlying_type::type v; in >> v; -- 2.20.1