Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::ranges::stride_view<V>::stride

Returns a copy of the underlying stride object stride_. Equivalent to return stride_;.

NotebookLM
constexpr ranges::range_difference_t<_Vp> stride() const noexcept;
(since C++23)

Returns a copy of the underlying stride object stride_. Equivalent to return stride_;.

Parameters

(none)

Return value

The stride value.

Example

example.cpp
#include <ranges>
 
int main()
{
    constexpr auto view = std::views::iota(1337)
                        | std::views::stride(42);
    static_assert(view.stride() == 42);
}

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.