Skip to content

Commit

Permalink
Add partial specialization dtype_traits<const T>. (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpkfft authored Oct 6, 2024
1 parent 2d1723c commit 5ead8f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/nanobind/ndarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ template <> struct dtype_traits<void> {
static constexpr auto name = descr<0>();
};

template <> struct dtype_traits<const void> {
static constexpr dlpack::dtype value{ 0, 0, 0 };
static constexpr auto name = descr<0>();
template <typename T> struct dtype_traits<const T> {
static constexpr dlpack::dtype value = dtype_traits<T>::value;
static constexpr auto name = dtype_traits<T>::name;
};

template <ssize_t... Is> struct shape {
Expand Down

0 comments on commit 5ead8f0

Please sign in to comment.