# std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>::extent

> C++ Atlas: `cppatlas.com/w/cpp/container/mdspan/extent` | Source: https://en.cppreference.com/w/cpp/container/mdspan/extent | Domain: Containers | Standards: C++23

Returns the extent of a mdspan at the rank index r. Equivalent to return extents().extent(r);.

## Official Specification Summary (cppreference)

```cpp
constexpr index_type extent( rank_type r ) const noexcept; // (since C++23)
```

Returns the extent of a `mdspan` at the rank index `r`. Equivalent to `return extents().extent(r);`.

### Parameters

- `r` - The rank index to get the extent size of

### Return value

The extent at the given rank index.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`extent`](https://en.cppreference.com/w/cpp/container/mdspan/extents/extent): returns dynamic extent size of an `extents` at a certain rank index (public member function of `std::extents<IndexType,Extents...>`)
- [`static_extent`](https://en.cppreference.com/w/cpp/container/mdspan/static_extent) [static]: returns the static extent size of a `mdspan` at a given rank index (public static member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/container/mdspan/extent (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.