mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 07:02:11 +00:00
minor adjustment to detail::is_copy_constructible (fixes #70)
This commit is contained in:
parent
88d1d04132
commit
b670b77060
@ -247,7 +247,7 @@ template <typename T, size_t N> struct intrinsic_type<T[N]> { typedef type
|
|||||||
/** \brief SFINAE helper class to check if a copy constructor is usable (in contrast to
|
/** \brief SFINAE helper class to check if a copy constructor is usable (in contrast to
|
||||||
* std::is_copy_constructible, this class also checks if the 'new' operator is accessible */
|
* std::is_copy_constructible, this class also checks if the 'new' operator is accessible */
|
||||||
template <typename T> struct is_copy_constructible {
|
template <typename T> struct is_copy_constructible {
|
||||||
template <typename T2> static std::true_type test(decltype(new T2(std::declval<T2>())) *);
|
template <typename T2> static std::true_type test(decltype(new T2(std::declval<std::add_lvalue_reference<T2>::type>())) *);
|
||||||
template <typename T2> static std::false_type test(...);
|
template <typename T2> static std::false_type test(...);
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user