# std::ranges::join_view<V>::end

> C++ Atlas: `cppatlas.com/w/cpp/ranges/join_view/end` | Source: https://en.cppreference.com/w/cpp/ranges/join_view/end | Domain: Ranges | Standards: C++20

Returns a sentinel or an iterator representing the end of the join_view.

## Official Specification Summary (cppreference)

```cpp
constexpr auto end(); // (1) (since C++20)

constexpr auto end() const
    requires ranges::input_range<const V> &&
             std::is_reference_v<ranges::range_reference_t<const V>>; // (2) (since C++20)
```

Returns a sentinel or an iterator representing the end of the `join_view`.

Let `base_` be the underlying view:

1) Equivalent to

   ```cpp
   if constexpr (ranges::forward_range<V> &&
                 std::is_reference_v<ranges::range_reference_t<V>> &&
                 ranges::forward_range<ranges::range_reference_t<V>> &&
                 ranges::common_range<V> &&
                 ranges::common_range<ranges::range_reference_t<V>>)
       return /*iterator*/</*simple-view*/<V>>{*this, ranges::end(base_)};
   else
       return /*sentinel*/</*simple-view*/<V>>{*this};
   ```

2) Equivalent to

   ```cpp
   if constexpr (ranges::forward_range<const V> &&
                 std::is_reference_v<ranges::range_reference_t<const V>> &&
                 ranges::forward_range<ranges::range_reference_t<const V>> &&
                 ranges::common_range<const V> &&
                 ranges::common_range<ranges::range_reference_t<const V>>)
       return /*iterator*/<true>{*this, ranges::end(base_)};
   else
       return /*sentinel*/<true>{*this};
   ```

### Parameters

(none)

### Return value

1) sentinel which compares equal to the end iterator.

2) iterator to the element following the last element.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`begin`](https://en.cppreference.com/w/cpp/ranges/join_view/begin): returns an iterator to the beginning (public member function)
- [`ranges::end`](https://en.cppreference.com/w/cpp/ranges/end) (C++20): returns a sentinel indicating the end of a range (customization point object)

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