libstdc++: std::slice Class Reference

libstdc++

std::slice Class Reference
Numerics » Numeric Arrays

`#include <slice_array.h>`

## Public Member Functions
| slice ()
| slice (size_t __o, size_t __d, size_t __s)
size_t | size () const
size_t | start () const
size_t | stride () const

## Friends
bool | operator== (const slice &, const slice &)=default

## Detailed Description

Class defining one-dimensional subset of an array.

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.

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.

Definition at line 61 of file slice_array.h.

## Friends And Related Symbol Documentation

## ◆ operator==

bool operator== | ( | const slice & | ,
|  | const slice & | )
| friend

Equality comparison.

References slice().

The documentation for this class was generated from the following file:

- slice_array.h