最終更新日時(UTC):
が更新

履歴 編集

function
<initializer_list>

std::initializer_list::begin(C++11)

const E* begin() const noexcept;           // C++11
constexpr const E* begin() const noexcept; // C++14

概要

先頭要素を指すポインタを取得する。

戻り値

配列の先頭要素を指すポインタを返す。

配列の要素数が空である場合、end()と同じ未規定のポインタ値を返す。

例外

投げない

#include <iostream>
#include <initializer_list>

int main()
{
  std::initializer_list<int> init = {1, 2, 3};

  decltype(init)::iterator it = init.begin();

  std::cout << *it << std::endl;
}

出力

1

バージョン

言語

  • C++11

処理系

参照