Invokes a callback with the (indices, value_ptr) for each cell in the array.
| 310 | // Invokes a callback with the (indices, value_ptr) for each cell in the |
| 311 | // array. |
| 312 | void Each(std::function<void(absl::Span<const int64>, T*)> f) { |
| 313 | std::vector<int64> index(sizes_.size()); |
| 314 | for (int64 i = 0; i < num_elements(); ++i, next_index(&index)) { |
| 315 | f(index, &values_[i]); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | // Invokes a callback with the (indices, value) for each cell in the array. |
| 320 | void Each(std::function<void(absl::Span<const int64>, T)> f) const { |