mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
address compilation issue in MSVC
This commit is contained in:
parent
048373c1b4
commit
12cf543804
@ -507,8 +507,9 @@ protected:
|
|||||||
template <typename T> /* Used to select the right casting operator in the two functions below */
|
template <typename T> /* Used to select the right casting operator in the two functions below */
|
||||||
using cast_target =
|
using cast_target =
|
||||||
typename std::conditional<
|
typename std::conditional<
|
||||||
is_tuple<typename intrinsic_type<T>::type>::value, /* special case: tuple/pair -> pass by value */
|
is_specialization_of<typename intrinsic_type<T>::type, std::tuple>::value ||
|
||||||
typename intrinsic_type<T>::type,
|
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<
|
typename std::conditional<
|
||||||
std::is_pointer<T>::value,
|
std::is_pointer<T>::value,
|
||||||
typename std::add_pointer<typename intrinsic_type<T>::type>::type, /* pass using pointer */
|
typename std::add_pointer<typename intrinsic_type<T>::type>::type, /* pass using pointer */
|
||||||
|
@ -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;
|
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, template <typename...> class Template>
|
||||||
template <typename T> struct is_tuple : std::false_type { };
|
struct is_specialization_of : std::false_type {};
|
||||||
template <typename... Args> struct is_tuple <std::tuple<Args...>> : std::true_type { };
|
template <template <typename...> class Template, typename... Args>
|
||||||
template <typename... Args> struct is_tuple <std::pair<Args...>> : std::true_type { };
|
struct is_specialization_of<Template<Args...>, Template> : std::true_type {};
|
||||||
|
|
||||||
/// Helper type to replace 'void' in some expressions
|
/// Helper type to replace 'void' in some expressions
|
||||||
struct void_type { };
|
struct void_type { };
|
||||||
|
Loading…
Reference in New Issue
Block a user