GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::dynamic-format-string - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. format
  3. dynamic-format-string

最終更新日時: 2026年05月15日 14時22分58秒 (JST)
Akira Takahashi が更新

履歴 編集

class
<format>

std::dynamic-format-string(C++26)

namespace std {

template <class charT>
struct dynamic-format-string {
private:
  basic_string_view<charT> str;  // 説明用

public:
  constexpr dynamic-format-string(basic_string_view<charT> s) noexcept : str(s) {}

  dynamic-format-string(const dynamic-format-string&) = delete;
  const dynamic-format-string& operator=(const dynamic-format-string&) = delete;
};

}

概要

dynamic-format-stringクラスは、実行時の書式文字列を表す説明用のクラスであり、ユーザーは使用できない。

このクラスは、std::stringやstd::string_viewの文字列を、書式文字列としてstd::format()関数に指定するためにある。

std::string fmt = "{}";
std::string s = std::format(std::dynamic_format(fmt), "Hello");

バージョン

言語

  • C++26

関連項目

  • std::format()
  • std::dynamic_format()
  • std::basic_format_stringクラスのコンストラクタ

参照

  • P2918R2 Runtime format strings II
  • P3391R2 constexpr std::format
  • P3953R3 Rename std::runtime_format
    • 元の名前はruntime-format-stringだったが、runtime_format関数のリネームと合わせてdynamic-format-stringにリネームされた
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.