FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
C++ standard support for "initializer_list". More...
#include <fastarduino/initializer_list.h>
Public Member Functions | |
constexpr | initializer_list ()=default |
Create an empty initializer list. | |
constexpr size_t | size () const |
The size of this initializer_list. More... | |
constexpr const T * | begin () const |
The first element of this initializer_list. More... | |
constexpr const T * | end () const |
One past the last element of this initializer_list. More... | |
C++ standard support for "initializer_list".
This creates a temporary array in C++11 list-initialization and then references it. An initializer_list instance is automatically constructed when a braced-init-list is used to list-initialize an object, where the corresponding constructor accepts an initializer_list parameter.
Using an initializer_list argument is done through a standard C++ iterator loop:
where the iterator type is simply const T*
. That code could also be written in a more traditional and more verbose way:
T | the type of objects in this initializer_list |
Definition at line 56 of file initializer_list.h.
|
inlineconstexpr |
|
inlineconstexpr |
The first element of this initializer_list.
Definition at line 79 of file initializer_list.h.
|
inlineconstexpr |
One past the last element of this initializer_list.
Definition at line 85 of file initializer_list.h.