This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

36
cppdraft/cons/slice.md Normal file
View File

@@ -0,0 +1,36 @@
[cons.slice]
# 29 Numerics library [[numerics]](./#numerics)
## 29.6 Numeric arrays [[numarray]](numarray#cons.slice)
### 29.6.4 Class slice [[class.slice]](class.slice#cons.slice)
#### 29.6.4.2 Constructors [cons.slice]
[🔗](#lib:slice,constructor)
`slice();
slice(size_t start, size_t length, size_t stride);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8420)
The default constructor is equivalent to slice(0, 0, 0)[.](#1.sentence-1)
A default constructor is provided only to permit the declaration of arrays of slices[.](#1.sentence-2)
The constructor with arguments for a slice takes a start, length, and stride
parameter[.](#1.sentence-3)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8426)
[*Example [1](#example-1)*:
slice(3, 8, 2) constructs a slice which selects elements 3,5,7,…,17 from an array[.](#2.sentence-1)
— *end example*]