std::ranges...iew::stride(3)
π std::ranges...iew::stride(3) π
okay so bestie, welcome to this lil corner of the C++ Standard Libary β yes that's the manual name, and yes we're keeping it exactly as it appears, no edits, periodt πβ¨. This page is about std::ranges::stride_view::stride, and she is lowkey a one-line icon.
πΈ NAME πΈ
std::ranges::stride_view::strideβstd::ranges::stride_view::stride
it's giving same-name energy, and honestly? obsessed π«Ά
β¨ Synopsis β¨
constexpr ranges::range_difference_t<_Vp> stride() const noexcept;
(since C++23) β yes, she's C++23-coded π
This one returns a copy of the underlying stride object stride_, and it's equivalent to return stride_;. literally that's the whole flex π
π Parameters π
(none)β zero parameters, not a single one, she takes nothing and still serves π
π¦ Return value π¦
The stride value. that's it, that's the tea ββ¨
π₯ Example π₯
// Run this code
#include <ranges>
int main()
{
constexpr auto view = std::views::iota(1337)
| std::views::stride(42);
static_assert(view.stride() == 42);
}
bestie this example is a whole vibe check: you build a view by piping std::views::iota(1337) into std::views::stride(42), then static_assert that view.stride() == 42. constexpr confidence, no cap πβ
mwah π this has been the std::ranges...iew::stride(3) page, brought to you by the C++ Standard Libary and source/version vibes from http://cppreference.com, dated 2024.06.10 β and yup, the footer is also out here repeating std::ranges...iew::stride(3), iconic behavior fr fr ππ«Ά
π¦ 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