std::initializer_list constructors
Default constructor
- od C++14
- do C++14
- Simplified
- Detailed
initializer_list();
- this constructor is
constexpr
andnoexcept
constexpr initializer_list() noexcept;
- Simplified
- Detailed
initializer_list();
- this constructor is
noexcept
initializer_list() noexcept;
Constructs an empty initializer list.
zanotuj
Despite a lack of constructors, it is possible to create non-empty initializer lists. Instances of std::initializer_list
are implicitly constructed when:
- a braced-init-list is used in list-initialization, including function-call list initialization and assignment expressions (not to be confused with constructor initializer lists)
- a braced-init-list is bound to auto, including in a ranged for loop