# std::ranges::transform_view<V,F>::end

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

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

## Official Specification Summary (cppreference)

```cpp
constexpr /*sentinel*/<false> end(); // (1) (since C++20)

constexpr /*iterator*/<false> end() requires ranges::common_range<V>; // (2) (since C++20)

constexpr /*sentinel*/<true> end() const
    requires ranges::range<const V> &&
             std::regular_invocable<const F&, ranges::range_reference_t<const V>>; // (3) (since C++20)

constexpr /*iterator*/<true> end() const
    requires ranges::common_range<const V> &&
             std::regular_invocable<const F&, ranges::range_reference_t<const V>>; // (4) (since C++20)
```

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

Let `base_` be the underlying view. Equivalent to:

1) `return /*sentinel*/<false>{ranges::end(base_)};`.

2) `return /*iterator*/<false>{*this, ranges::end(base_)};`.

3) `return /*sentinel*/<true>{ranges::end(base_)};`.

4) `return /*iterator*/<true>{*this, ranges::end(base_)};`.

### Parameters

(none)

### Return value

1,3) sentinel which compares equal to the end iterator

2,4) iterator to the element following the last element

### Notes

`end()` returns an iterator if and only if the underlying view is a `common_range`: `transform_view<V,F>` models `common_range` whenever `V` does.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`begin`](https://en.cppreference.com/w/cpp/ranges/transform_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/transform_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.