# std::layout_stride

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

layout_stride is a LayoutMappingPolicy which provides a layout mapping where the strides are user-defined.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <mdspan>
struct layout_stride; // (since C++23)
```

`layout_stride` is a *LayoutMappingPolicy* which provides a layout mapping where the strides are user-defined.

`layout_stride` is a *TrivialType*. (until C++26)

`layout_stride` is *TriviallyCopyable*, and `std::is_trivially_default_constructible_v<layout_stride>` is `true`. (since C++26)

### Nested class templates

- `mapping`: a layout mapping of `layout_stride` (public member class template)

### See also

- [`layout_left`](https://en.cppreference.com/w/cpp/container/mdspan/layout_left) (C++23): column-major multidimensional array layout mapping policy; leftmost extent has stride `1` (class)
- [`layout_left_padded`](https://en.cppreference.com/w/cpp/container/mdspan/layout_left_padded) (C++26): column-major layout mapping policy with padding stride that can be greater than or equal to the leftmost extent (class template)
- [`layout_right`](https://en.cppreference.com/w/cpp/container/mdspan/layout_right) (C++23): row-major multidimensional array layout mapping policy; rightmost extent has stride `1` (class)
- [`layout_right_padded`](https://en.cppreference.com/w/cpp/container/mdspan/layout_right_padded) (C++26): row-major layout mapping policy with padding stride that can be greater than or equal to the rightmost extent (class template)

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