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

View File

@@ -0,0 +1,23 @@
[intseq.general]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.2 Compile-time integer sequences [[intseq]](intseq#general)
### 21.2.1 General [intseq.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L21)
The library provides a class template that can represent an integer sequence[.](#1.sentence-1)
When used as an argument to a function template the template parameter pack defining the
sequence can be deduced and used in a pack expansion[.](#1.sentence-2)
[*Note [1](#note-1)*:
The index_sequence alias template is provided for the common case of
an integer sequence of type size_t; see also [[tuple.apply]](tuple.apply "22.4.6Calling a function with a tuple of arguments")[.](#1.sentence-3)
— *end note*]

17
cppdraft/intseq/intseq.md Normal file
View File

@@ -0,0 +1,17 @@
[intseq.intseq]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.2 Compile-time integer sequences [[intseq]](intseq#intseq)
### 21.2.2 Class template integer_sequence [intseq.intseq]
[🔗](#lib:integer_sequence)
namespace std {template<class T, T... I> struct integer_sequence {using value_type = T; static constexpr size_t size() noexcept { return sizeof...(I); }};}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L43)
*Mandates*: T is an integer type[.](#1.sentence-1)

33
cppdraft/intseq/make.md Normal file
View File

@@ -0,0 +1,33 @@
[intseq.make]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.2 Compile-time integer sequences [[intseq]](intseq#make)
### 21.2.3 Alias template make_integer_sequence [intseq.make]
[🔗](#lib:make_integer_sequence)
`template<class T, T N>
using make_integer_sequence = integer_sequence<T, see below>;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L56)
*Mandates*: N ≥ 0[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L60)
The alias templatemake_integer_sequence denotes a specialization ofinteger_sequence with N constant template arguments[.](#2.sentence-1)
The type make_integer_sequence<T, N> is an alias for the typeinteger_sequence<T, 0, 1, …, N - 1>[.](#2.sentence-2)
[*Note [1](#note-1)*:
make_integer_sequence<int, 0> is an alias for the typeinteger_sequence<int>[.](#2.sentence-3)
— *end note*]