From 12cf543804ae90db08bcb2c836141fcf1b037e28 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 26 Mar 2016 17:29:33 +0100 Subject: [PATCH] address compilation issue in MSVC --- include/pybind11/cast.h | 5 +++-- include/pybind11/common.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 13e99c411..7f30fd29f 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -507,8 +507,9 @@ protected: template /* Used to select the right casting operator in the two functions below */ using cast_target = typename std::conditional< - is_tuple::type>::value, /* special case: tuple/pair -> pass by value */ - typename intrinsic_type::type, + is_specialization_of::type, std::tuple>::value || + is_specialization_of::type, std::pair>::value, + typename intrinsic_type::type, /* special case: tuple/pair -> pass by value */ typename std::conditional< std::is_pointer::value, typename std::add_pointer::type>::type, /* pass using pointer */ diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 7a586563a..31306d4b3 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -257,10 +257,10 @@ template struct is_copy_constructible { static const bool value = std::is_same(nullptr))>::value; }; -/// Helper type determine if another type is a variant of a pair/tuple -template struct is_tuple : std::false_type { }; -template struct is_tuple > : std::true_type { }; -template struct is_tuple > : std::true_type { }; +template class Template> +struct is_specialization_of : std::false_type {}; +template