| 1254 | */ |
| 1255 | template <typename T, ssize_t Dims = -1> |
| 1256 | detail::unchecked_reference<T, Dims> unchecked() const & { |
| 1257 | if (Dims >= 0 && ndim() != Dims) { |
| 1258 | throw std::domain_error("array has incorrect number of dimensions: " |
| 1259 | + std::to_string(ndim()) + "; expected " |
| 1260 | + std::to_string(Dims)); |
| 1261 | } |
| 1262 | return detail::unchecked_reference<T, Dims>(data(), shape(), strides(), ndim()); |
| 1263 | } |
| 1264 | |
| 1265 | /// Return a new view with all of the dimensions of length 1 removed |
| 1266 | array squeeze() { |