| 1032 | */ |
| 1033 | template <typename T, ssize_t Dims = -1> |
| 1034 | detail::unchecked_reference<T, Dims> unchecked() const & { |
| 1035 | if (Dims >= 0 && ndim() != Dims) { |
| 1036 | throw std::domain_error("array has incorrect number of dimensions: " |
| 1037 | + std::to_string(ndim()) + "; expected " |
| 1038 | + std::to_string(Dims)); |
| 1039 | } |
| 1040 | return detail::unchecked_reference<T, Dims>(data(), shape(), strides(), ndim()); |
| 1041 | } |
| 1042 | |
| 1043 | /// Return a new view with all of the dimensions of length 1 removed |
| 1044 | array squeeze() { |