File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -577,6 +577,8 @@ class array : public buffer {
577
577
578
578
template <typename T, int ExtraFlags = array::forcecast> class array_t : public array {
579
579
public:
580
+ using value_type = T;
581
+
580
582
array_t () : array(0 , static_cast <const T *>(nullptr )) {}
581
583
array_t (handle h, borrowed_t ) : array(h, borrowed) { }
582
584
array_t (handle h, stolen_t ) : array(h, stolen) { }
Original file line number Diff line number Diff line change 17
17
18
18
using arr = py::array;
19
19
using arr_t = py::array_t <uint16_t , 0 >;
20
+ static_assert (std::is_same<arr_t ::value_type, uint16_t >::value, " " );
20
21
21
22
template <typename ... Ix> arr data (const arr& a, Ix... index) {
22
23
return arr (a.nbytes () - a.offset_at (index ...), (const uint8_t *) a.data (index ...));
You can’t perform that action at this time.
0 commit comments