• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <chrono>

    std::chrono::tzdb_list::begin

    const_iterator begin() const noexcept;
    

    概要

    先頭要素を指すイテレータを取得する。

    戻り値

    先頭要素を指すイテレータ

    例外

    投げない

    #include <iostream>
    #include <chrono>
    
    namespace chrono = std::chrono;
    
    int main()
    {
      const chrono::tzdb_list& ls = chrono::get_tzdb_list();
    
      int n = std::distance(ls.begin(), ls.end());
      std::cout << n << std::endl;
    
      for (const chrono::tzdb& tzdb : ls) {
        std::cout << tzdb.version << std::endl;
      }
    }
    

    出力例

    1
    2019c
    

    バージョン

    言語

    • C++20

    処理系