# operator==(std::extents)

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

Compares two extents. Returns true if lhs.rank() equals rhs.rank() and lhs.extent(r) equals rhs.extent(r) for every rank index r of rhs; otherwise returns false.

## Official Specification Summary (cppreference)

```cpp
template< class OtherIndexType, std::size_t... OtherExtents >
friend constexpr bool operator==(
    const extents& lhs, const extents<OtherIndexType, OtherExtents...>& rhs ) noexcept; // (since C++23)
```

Compares two `extents`. Returns `true` if `lhs.rank()` equals `rhs.rank()` and `lhs.extent(r)` equals `rhs.extent(r)` for every rank index `r` of `rhs`; otherwise returns `false`.

### Parameters

- `lhs, rhs` - extents whose values to compare

### Return value

`true` if the extents represented by `lhs` and `rhs` are equal, `false` otherwise

### Example

> Note: This section is incomplete Reason: no example

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