mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 01:36:21 +00:00
Add dtype_of<T>() function, update the tests
This commit is contained in:
@@ -169,6 +169,11 @@ template <typename T> struct format_descriptor
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
object dtype_of() {
|
||||
return detail::npy_format_descriptor<T>::descr();
|
||||
}
|
||||
|
||||
NAMESPACE_BEGIN(detail)
|
||||
|
||||
template <typename T> struct npy_format_descriptor<T, typename std::enable_if<std::is_integral<T>::value>::type> {
|
||||
|
||||
Reference in New Issue
Block a user