tmp/tmp5mxwu_12/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
## Initializer lists <a id="support.initlist">[[support.initlist]]</a>
|
| 2 |
|
| 3 |
-
The header `<initializer_list>` defines
|
|
|
|
|
|
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class E> class initializer_list {
|
| 8 |
public:
|
|
@@ -12,20 +14,20 @@ namespace std {
|
|
| 12 |
typedef size_t size_type;
|
| 13 |
|
| 14 |
typedef const E* iterator;
|
| 15 |
typedef const E* const_iterator;
|
| 16 |
|
| 17 |
-
initializer_list() noexcept;
|
| 18 |
|
| 19 |
-
size_t size() const noexcept; // number of elements
|
| 20 |
-
const E* begin() const noexcept; // first element
|
| 21 |
-
const E* end() const noexcept; // one past the last element
|
| 22 |
};
|
| 23 |
|
| 24 |
// [support.initlist.range] initializer list range access
|
| 25 |
-
template<class E> const E* begin(initializer_list<E> il) noexcept;
|
| 26 |
-
template<class E> const E* end(initializer_list<E> il) noexcept;
|
| 27 |
}
|
| 28 |
```
|
| 29 |
|
| 30 |
An object of type `initializer_list<E>` provides access to an array of
|
| 31 |
objects of type `const E`. A pair of pointers or a pointer plus a length
|
|
@@ -35,50 +37,50 @@ in [[dcl.init.list]]. Copying an initializer list does not copy the
|
|
| 35 |
underlying elements.
|
| 36 |
|
| 37 |
### Initializer list constructors <a id="support.initlist.cons">[[support.initlist.cons]]</a>
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
-
initializer_list() noexcept;
|
| 41 |
```
|
| 42 |
|
| 43 |
*Effects:* constructs an empty `initializer_list` object.
|
| 44 |
|
| 45 |
`size() == 0`
|
| 46 |
|
| 47 |
### Initializer list access <a id="support.initlist.access">[[support.initlist.access]]</a>
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
-
const E* begin() const noexcept;
|
| 51 |
```
|
| 52 |
|
| 53 |
*Returns:* A pointer to the beginning of the array. If `size() == 0` the
|
| 54 |
values of `begin()` and `end()` are unspecified but they shall be
|
| 55 |
identical.
|
| 56 |
|
| 57 |
``` cpp
|
| 58 |
-
const E* end() const noexcept;
|
| 59 |
```
|
| 60 |
|
| 61 |
*Returns:* `begin() + size()`
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
-
size_t size() const noexcept;
|
| 65 |
```
|
| 66 |
|
| 67 |
*Returns:* The number of elements in the array.
|
| 68 |
|
| 69 |
-
*Complexity:*
|
| 70 |
|
| 71 |
### Initializer list range access <a id="support.initlist.range">[[support.initlist.range]]</a>
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
-
template<class E> const E* begin(initializer_list<E> il) noexcept;
|
| 75 |
```
|
| 76 |
|
| 77 |
*Returns:* `il.begin()`.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
-
template<class E> const E* end(initializer_list<E> il) noexcept;
|
| 81 |
```
|
| 82 |
|
| 83 |
*Returns:* `il.end()`.
|
| 84 |
|
|
|
|
| 1 |
## Initializer lists <a id="support.initlist">[[support.initlist]]</a>
|
| 2 |
|
| 3 |
+
The header `<initializer_list>` defines a class template and several
|
| 4 |
+
support functions related to list-initialization (see
|
| 5 |
+
[[dcl.init.list]]).
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
namespace std {
|
| 9 |
template<class E> class initializer_list {
|
| 10 |
public:
|
|
|
|
| 14 |
typedef size_t size_type;
|
| 15 |
|
| 16 |
typedef const E* iterator;
|
| 17 |
typedef const E* const_iterator;
|
| 18 |
|
| 19 |
+
constexpr initializer_list() noexcept;
|
| 20 |
|
| 21 |
+
constexpr size_t size() const noexcept; // number of elements
|
| 22 |
+
constexpr const E* begin() const noexcept; // first element
|
| 23 |
+
constexpr const E* end() const noexcept; // one past the last element
|
| 24 |
};
|
| 25 |
|
| 26 |
// [support.initlist.range] initializer list range access
|
| 27 |
+
template<class E> constexpr const E* begin(initializer_list<E> il) noexcept;
|
| 28 |
+
template<class E> constexpr const E* end(initializer_list<E> il) noexcept;
|
| 29 |
}
|
| 30 |
```
|
| 31 |
|
| 32 |
An object of type `initializer_list<E>` provides access to an array of
|
| 33 |
objects of type `const E`. A pair of pointers or a pointer plus a length
|
|
|
|
| 37 |
underlying elements.
|
| 38 |
|
| 39 |
### Initializer list constructors <a id="support.initlist.cons">[[support.initlist.cons]]</a>
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
+
constexpr initializer_list() noexcept;
|
| 43 |
```
|
| 44 |
|
| 45 |
*Effects:* constructs an empty `initializer_list` object.
|
| 46 |
|
| 47 |
`size() == 0`
|
| 48 |
|
| 49 |
### Initializer list access <a id="support.initlist.access">[[support.initlist.access]]</a>
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
+
constexpr const E* begin() const noexcept;
|
| 53 |
```
|
| 54 |
|
| 55 |
*Returns:* A pointer to the beginning of the array. If `size() == 0` the
|
| 56 |
values of `begin()` and `end()` are unspecified but they shall be
|
| 57 |
identical.
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
+
constexpr const E* end() const noexcept;
|
| 61 |
```
|
| 62 |
|
| 63 |
*Returns:* `begin() + size()`
|
| 64 |
|
| 65 |
``` cpp
|
| 66 |
+
constexpr size_t size() const noexcept;
|
| 67 |
```
|
| 68 |
|
| 69 |
*Returns:* The number of elements in the array.
|
| 70 |
|
| 71 |
+
*Complexity:* Constant time.
|
| 72 |
|
| 73 |
### Initializer list range access <a id="support.initlist.range">[[support.initlist.range]]</a>
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
+
template<class E> constexpr const E* begin(initializer_list<E> il) noexcept;
|
| 77 |
```
|
| 78 |
|
| 79 |
*Returns:* `il.begin()`.
|
| 80 |
|
| 81 |
``` cpp
|
| 82 |
+
template<class E> constexpr const E* end(initializer_list<E> il) noexcept;
|
| 83 |
```
|
| 84 |
|
| 85 |
*Returns:* `il.end()`.
|
| 86 |
|