diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 8653fc19..e2b5a16a 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -29,6 +29,8 @@ NAMESPACE_BEGIN(pybind11) namespace detail { template struct npy_format_descriptor { }; template struct is_pod_struct; +template using decay_cv_ref = + typename std::remove_cv::type>::type; struct npy_api { enum constants { @@ -321,14 +323,15 @@ template struct is_std_array> : std::tru template struct is_pod_struct { enum { value = std::is_pod::value && // offsetof only works correctly for POD types + !std::is_reference::value && !std::is_array::value && !is_std_array::value && !std::is_integral::value && - !std::is_same::value && - !std::is_same::value && - !std::is_same::value && - !std::is_same>::value && - !std::is_same>::value }; + !std::is_same::type, float>::value && + !std::is_same::type, double>::value && + !std::is_same::type, bool>::value && + !std::is_same::type, std::complex>::value && + !std::is_same::type, std::complex>::value }; }; template struct npy_format_descriptor::value>::type> {