A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/support.initlist below:

[support.initlist]

21 Language support library [language.support] 21.9 Initializer lists [support.initlist]

The header <initializer_­list> defines a class template and several support functions related to list-initialization (see [dcl.init.list]). All functions specified in this subclause are signal-safe ([csignal.syn]).

21.9.1 Header <initializer_­list> synopsis [initializer_list.syn]
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;         constexpr const E* begin() const noexcept;      constexpr const E* end() const noexcept;      };

    template<class E> constexpr const E* begin(initializer_list<E> il) noexcept;
  template<class E> constexpr const E* end(initializer_list<E> il) noexcept;
}

An object of type initializer_­list<E> provides access to an array of objects of type const E. [Note: A pair of pointers or a pointer plus a length would be obvious representations for initializer_­list. initializer_­list is used to implement initializer lists as specified in [dcl.init.list]. Copying an initializer list does not copy the underlying elements. end note]

If an explicit specialization or partial specialization of initializer_­list is declared, the program is ill-formed.

21.9.2 Initializer list constructors [support.initlist.cons]

constexpr initializer_list() noexcept;

Effects: Constructs an empty initializer_­list object.

Postconditions: size() == 0.

21.9.3 Initializer list access [support.initlist.access]

constexpr const E* begin() const noexcept;

Returns: A pointer to the beginning of the array. If size() == 0 the values of begin() and end() are unspecified but they shall be identical.

constexpr const E* end() const noexcept;

Returns: begin() + size().

constexpr size_t size() const noexcept;

Returns: The number of elements in the array.

Complexity: Constant time.

21.9.4 Initializer list range access [support.initlist.range]

template<class E> constexpr const E* begin(initializer_list<E> il) noexcept;

template<class E> constexpr const E* end(initializer_list<E> il) noexcept;


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4