std::contiguous_iterator(3)
π NAME π
okay bestie, this is the page for std::contiguous_iterator(3), straight out of the C++ Standard Libary manual, and the name is literally std::contiguous_iterator β thatβs it, thatβs the icon β¨
πΈ Synopsis πΈ
Defined in header <iterator> π
This whole concept is since C++20, and hereβs the exact shape of it:
template< class I >
concept contiguous_iterator =
std::random_access_iterator<I> &&
std::derived_from</*ITER_CONCEPT*/<I>,
std::contiguous_iterator_tag> &&
std::is_lvalue_reference_v<std::iter_reference_t<I>> &&
std::same_as<
std::iter_value_t<I>,
std::remove_cvref_t<std::iter_reference_t<I>>
> &&
requires(const I& i) {
{ std::to_address(i) } ->
std::same_as<std::add_pointer_t<std::iter_reference_t<I>>>;
};
so basically the contiguous_iterator concept refines random_access_iterator by giving you one extra guarantee: the denoted elements are stored contiguously in the memory π§ β¨ no cap.
π¦ Notes π¦
contiguous_iteratoris modeled by every pointer type to complete object type π- Iterator types in the standard library that are required to satisfy the
LegacyContiguousIteratorrequirements in C++17 are also required to modelcontiguous_iteratorin C++20 π
π See also π
random_access_iterator(C++20) (concept) β specifies that abidirectional_iteratoris a random-access iterator, supporting advancement in constant time and subscripting π
okay bye bestie, this page came from http://cppreference.com, dated 2024.06.10, and the manual tag is std::contiguous_iterator(3) β slay and stay contiguous ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms