@@ -23,7 +23,7 @@ auto register_vector_type(nb::module_ &m, const char *name) {
2323 .def (nb::init<const Array &>())
2424 .def (" __init__" , [](Array &a, const std::array<Value, Size> &arr) {
2525 new (&a) Array ();
26- for (size_t i = 0 ; i < Size; ++i)
26+ for (size_t i = 0 ; i < Array:: Size; ++i)
2727 a[i] = arr[i];
2828 })
2929 .def (nb::self == nb::self)
@@ -40,13 +40,13 @@ auto register_vector_type(nb::module_ &m, const char *name) {
4040 .def (nb::self -= nb::self)
4141 .def (nb::self *= nb::self)
4242 .def (nb::self /= nb::self)
43- .def (" __getitem__" , [Size ](const Array &a, size_t index) -> Value {
44- if (index >= Size)
43+ .def (" __getitem__" , [](const Array &a, size_t index) -> Value {
44+ if (index >= Array:: Size)
4545 throw nb::index_error ();
4646 return a[index];
4747 }, " index" _a)
48- .def (" __setitem__" , [Size ](Array &a, size_t index, Value value) {
49- if (index >= Size)
48+ .def (" __setitem__" , [](Array &a, size_t index, Value value) {
49+ if (index >= Array:: Size)
5050 throw nb::index_error ();
5151 a[index] = value;
5252 }, " index" _a, " value" _a)
@@ -56,7 +56,7 @@ auto register_vector_type(nb::module_ &m, const char *name) {
5656 [](Array &a, const Value &v) { a.y () = v; })
5757 .def (" __dlpack__" , [](nb::handle_t <Array> self) {
5858 const Array &a = nb::cast<const Array &>(self);
59- const size_t shape[1 ] = { Size };
59+ const size_t shape[1 ] = { Array:: Size };
6060 return nb::tensor<float >((void *) a.data (), 1 , shape, self);
6161 })
6262 .def (" __repr__" , [](const Array &a) {
0 commit comments