std::begin(std::initializer_list)
Материал из cppreference.com
< cpp | utility | initializer list
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| template< class E > const E* begin( initializer_list<E> il ); |
(начиная с C++11) | |
Специализация std::begin для
initializer_list возвращает указатель на первый элемент il.Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Содержание |
[править] Параметры
| il | - | an initializer_list
|
[править] Возвращаемое значение
il.begin()
[править] Исключения
[править] Пример
#include <iostream> int main() { // range-based for uses std::begin and std::end to iterate // over a given range; in this case, it's an initializer list for (int i : {3, 1, 4, 1}) { std::cout << i << '\n'; } }
Вывод:
3 1 4 1
[править] См. также
| возвращает указатель на первый элемент Original: returns a pointer the first element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public функция-член) | |