標準庫標頭檔案 <initializer_list> (C++11)
來自 cppreference.com
此標頭檔案是語言支援庫的一部分。
類 | |
(C++11) |
引用在列表初始化中建立的臨時陣列 (類模板) |
函式 | |
過載 std::begin (函式模板) | |
特化 std::end (函式模板) |
[編輯] 概要
// all freestanding namespace std { template<class E> class initializer_list { public: using value_type = E; using reference = const E&; using const_reference = const E&; using size_type = size_t; using iterator = const E*; using const_iterator = const E*; constexpr initializer_list() noexcept; constexpr size_t size() const noexcept; // number of elements constexpr const E* begin() const noexcept; // first element constexpr const E* end() const noexcept; // one past the last element }; // initializer list range access template<class E> constexpr const E* begin(initializer_list<E> il) noexcept; template<class E> constexpr const E* end(initializer_list<E> il) noexcept; }