38 lines
1.4 KiB
Markdown
38 lines
1.4 KiB
Markdown
[range.concat.overview]
|
||
|
||
# 25 Ranges library [[ranges]](./#ranges)
|
||
|
||
## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.concat.overview)
|
||
|
||
### 25.7.18 Concat view [[range.concat]](range.concat#overview)
|
||
|
||
#### 25.7.18.1 Overview [range.concat.overview]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L8697)
|
||
|
||
concat_view presents a view that concatenates all the underlying ranges[.](#1.sentence-1)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L8700)
|
||
|
||
The name views::concat denotes
|
||
a customization point object ([[customization.point.object]](customization.point.object "16.3.3.3.5 Customization Point Object types"))[.](#2.sentence-1)
|
||
|
||
Given a pack of subexpressions Es...,
|
||
the expression views::concat(Es...) is expression-equivalent to
|
||
|
||
- [(2.1)](#2.1)
|
||
|
||
views::all(Es...) if Es is a pack with only one element
|
||
whose type models [input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]"),
|
||
|
||
- [(2.2)](#2.2)
|
||
|
||
otherwise, concat_view(Es...)[.](#2.sentence-2)
|
||
|
||
[*Example [1](#example-1)*: vector<int> v1{1, 2, 3}, v2{4, 5}, v3{};
|
||
array a{6, 7, 8};auto s = views::single(9);for (auto&& i : views::concat(v1, v2, v3, a, s)) { print("{} ", i); // prints 1 2 3 4 5 6 7 8 9} â *end example*]
|