---
name: "std::default_sentinel_t"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::default_sentinel_t"
---

# std::default\_sentinel\_t(3cxx)

## NAME

std::default\_sentinel\_t

## SYNOPSIS

`#include <iterator>`

## Detailed Description

A sentinel type that can be used to check for the end of a range.

For some iterator types the past-the-end sentinel value is independent of the underlying sequence, and a default sentinel can be used with them. For example, a `std::counted_iterator` keeps a count of how many elements remain, and so checking for the past-the-end value only requires checking if that count has reached zero. A past-the-end `std::istream_iterator` is equal to the default-constructed value, which can be easily checked.

Comparing iterators of these types to `std::default_sentinel` is a convenient way to check if the end has been reached.

**Since**

C++20

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
