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

履歴 編集

function
<format>

std::basic_format_args::get(C++20)

basic_format_arg<Context> get(std::size_t i) const noexcept;

概要

i番目のフォーマット引数を得る。iが範囲外の場合、basic_format_arg<Context>のデフォルト値を返す。

例外

投げない。

実装例

namespace std {
  template<class Context>
  class basic_format_args {
    std::size_t size_;
    const basic_format_arg<Context>* data_;

  public:
    basic_format_arg<Context> get(std::size_t i) const noexcept
    {
      return i < size_ ? data_[i] : basic_format_arg<Context>();
    }
  };
}

バージョン

言語

  • C++20

処理系

参照