std::slice(3cxx)

🌸 std::slice β€” libstdc++ manual page, section 3cxx 🌸

Okay bestie, this is the libstdc++ manual page for std::slice, filed under section 3cxx. It’s giving one-dimensional-subset-of-an-array energy, and we’re covering every last detail. πŸ’…βœ¨


πŸŽ€ NAME πŸŽ€

std::slice β€” Class defining one-dimensional subset of an array. πŸ¦‹

🧚 SYNOPSIS 🧚

#include <valarray>

πŸ’– Public Member Functions πŸ’–

  • slice () β€” Construct an empty slice. Empty-slice era, zero elements, no cap. ✨
  • slice (size_t __o, size_t __d, size_t __s) β€” Construct a slice from those three parameters. The signature is exactly that, so don’t come for the underscores. πŸ’…
  • size_t size () const β€” Return size of slice. It tells you how many elements are in the subset. πŸŽ€
  • size_t start () const β€” Return array offset of first slice element. That’s where the slice starts in the array. 🌸
  • size_t stride () const β€” Return array stride of slice. That’s the step distance between included array elements. πŸ¦‹

πŸ’ž Friends πŸ’ž

  • bool operator== (const slice &, const slice &)=default β€” Equality comparison. Friend behavior, defaulted, iconic. πŸ‘‘

πŸ” Detailed Description πŸ”

Class defining one-dimensional subset of an array. Yes, that’s the whole concept, and it ate. πŸ’…

The slice class represents a one-dimensional subset of an array, specified by three parameters: start offset, size, and stride. The start offset is the index of the first element of the array that is part of the subset. The size is the total number of elements in the subset. Stride is the distance between each successive array element to include in the subset. Periodt. ✨

For example, with an array of size 10, and a slice with offset 1, size 3 and stride 2, the subset consists of array elements 1, 3, and 5. That’s the example, verbatim numbers and all, bestie. πŸ“

🌈 bool operator== (const slice &, const slice &) [friend] 🌈

  • bool operator== (const slice &, const slice &) [friend] β€” Equality comparison. This is the friend version, documented right here. 🫢

🧚 Author 🧚

Generated automatically by Doxygen for libstdc++ from the source code. So it wasn’t hand-written by a mysterious author; Doxygen did its little autogen thing. πŸ€–πŸ’–


Sign-off: the source/version is libstdc++, the manual page is std::slice(3cxx), and the original footer doesn’t list a date β€” so no fake date energy from me, bestie. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from