address compilation issue in MSVC

This commit is contained in:
Wenzel Jakob 2016-03-26 17:29:33 +01:00
parent 048373c1b4
commit 12cf543804
2 changed files with 7 additions and 6 deletions

View File

@ -507,8 +507,9 @@ protected:
template <typename T> /* Used to select the right casting operator in the two functions below */
using cast_target =
typename std::conditional<
is_tuple<typename intrinsic_type<T>::type>::value, /* special case: tuple/pair -> pass by value */
typename intrinsic_type<T>::type,
is_specialization_of<typename intrinsic_type<T>::type, std::tuple>::value ||
is_specialization_of<typename intrinsic_type<T>::type, std::pair>::value,
typename intrinsic_type<T>::type, /* special case: tuple/pair -> pass by value */
typename std::conditional<
std::is_pointer<T>::value,
typename std::add_pointer<typename intrinsic_type<T>::type>::type, /* pass using pointer */

View File

@ -257,10 +257,10 @@ template <typename T> struct is_copy_constructible {
static const bool value = std::is_same<std::true_type, decltype(test<T>(nullptr))>::value;
};
/// Helper type determine if another type is a variant of a pair/tuple
template <typename T> struct is_tuple : std::false_type { };
template <typename... Args> struct is_tuple <std::tuple<Args...>> : std::true_type { };
template <typename... Args> struct is_tuple <std::pair<Args...>> : std::true_type { };
template <typename T, template <typename...> class Template>
struct is_specialization_of : std::false_type {};
template <template <typename...> class Template, typename... Args>
struct is_specialization_of<Template<Args...>, Template> : std::true_type {};
/// Helper type to replace 'void' in some expressions
struct void_type { };