tmp/tmppxbi78q_/{from.md → to.md}
RENAMED
|
@@ -1,42 +1,43 @@
|
|
| 1 |
## Compile-time integer sequences <a id="intseq">[[intseq]]</a>
|
| 2 |
|
| 3 |
### In general <a id="intseq.general">[[intseq.general]]</a>
|
| 4 |
|
| 5 |
The library provides a class template that can represent an integer
|
| 6 |
-
sequence. When used as an argument to a function template the
|
| 7 |
-
pack defining the sequence can be deduced and used in a pack
|
|
|
|
| 8 |
|
| 9 |
[*Note 1*: The `index_sequence` alias template is provided for the
|
| 10 |
common case of an integer sequence of type `size_t`; see also
|
| 11 |
[[tuple.apply]]. — *end note*]
|
| 12 |
|
| 13 |
### Class template `integer_sequence` <a id="intseq.intseq">[[intseq.intseq]]</a>
|
| 14 |
|
| 15 |
``` cpp
|
| 16 |
namespace std {
|
| 17 |
-
template<class T, T... I>
|
| 18 |
-
struct integer_sequence {
|
| 19 |
using value_type = T;
|
| 20 |
static constexpr size_t size() noexcept { return sizeof...(I); }
|
| 21 |
};
|
| 22 |
}
|
| 23 |
```
|
| 24 |
|
| 25 |
-
`T`
|
| 26 |
|
| 27 |
### Alias template `make_integer_sequence` <a id="intseq.make">[[intseq.make]]</a>
|
| 28 |
|
| 29 |
``` cpp
|
| 30 |
template<class T, T N>
|
| 31 |
using make_integer_sequence = integer_sequence<T, see below>;
|
| 32 |
```
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
`
|
|
|
|
| 38 |
`integer_sequence<T, 0, 1, ..., N-1>`.
|
| 39 |
|
| 40 |
-
[*Note 1*: `make_integer_sequence<int, 0>`
|
| 41 |
-
`integer_sequence<int>` — *end note*]
|
| 42 |
|
|
|
|
| 1 |
## Compile-time integer sequences <a id="intseq">[[intseq]]</a>
|
| 2 |
|
| 3 |
### In general <a id="intseq.general">[[intseq.general]]</a>
|
| 4 |
|
| 5 |
The library provides a class template that can represent an integer
|
| 6 |
+
sequence. When used as an argument to a function template the template
|
| 7 |
+
parameter pack defining the sequence can be deduced and used in a pack
|
| 8 |
+
expansion.
|
| 9 |
|
| 10 |
[*Note 1*: The `index_sequence` alias template is provided for the
|
| 11 |
common case of an integer sequence of type `size_t`; see also
|
| 12 |
[[tuple.apply]]. — *end note*]
|
| 13 |
|
| 14 |
### Class template `integer_sequence` <a id="intseq.intseq">[[intseq.intseq]]</a>
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
namespace std {
|
| 18 |
+
template<class T, T... I> struct integer_sequence {
|
|
|
|
| 19 |
using value_type = T;
|
| 20 |
static constexpr size_t size() noexcept { return sizeof...(I); }
|
| 21 |
};
|
| 22 |
}
|
| 23 |
```
|
| 24 |
|
| 25 |
+
*Mandates:* `T` is an integer type.
|
| 26 |
|
| 27 |
### Alias template `make_integer_sequence` <a id="intseq.make">[[intseq.make]]</a>
|
| 28 |
|
| 29 |
``` cpp
|
| 30 |
template<class T, T N>
|
| 31 |
using make_integer_sequence = integer_sequence<T, see below>;
|
| 32 |
```
|
| 33 |
|
| 34 |
+
*Mandates:* `N` ≥ 0.
|
| 35 |
+
|
| 36 |
+
The alias template `make_integer_sequence` denotes a specialization of
|
| 37 |
+
`integer_sequence` with `N` non-type template arguments. The type
|
| 38 |
+
`make_integer_sequence<T, N>` is an alias for the type
|
| 39 |
`integer_sequence<T, 0, 1, ..., N-1>`.
|
| 40 |
|
| 41 |
+
[*Note 1*: `make_integer_sequence<int, 0>` is an alias for the type
|
| 42 |
+
`integer_sequence<int>`. — *end note*]
|
| 43 |
|