# std::dynamic_extent

From cppreference.com
< cpp‎ | container‎ | span

Defined in header `<span>` |  |
inline constexpr std::size_t dynamic_extent = std::numeric_limits < std::size_t >::max(); |  | (since C++20)

`std::dynamic_extent` is a constant of type std::size_t that is used to differentiate `std::span` of static and dynamic extent.

### Note

Since `std::size_t` is an unsigned type, an equivalent definition is:

    inline constexpr std::size_t dynamic_extent = -1;

See integral conversions.

### See also

span (C++20) | a non-owning view over a contiguous sequence of objects (class template)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/span/dynamic_extent&oldid=110374"