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::formatter - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. stacktrace
  3. stacktrace_entry
  4. formatter

最終更新日時: 2024年06月11日 22時45分38秒 (JST)
Akira Takahashi が更新

履歴 編集

class
<stacktrace>

std::formatter(C++23)

namespace std {
  struct formatter<stacktrace_entry>;
}

概要

stacktrace_entryクラスに対するstd::formatterクラステンプレートの特殊化。

フォーマットフラグとしては、以下を使用できる:

[[fill] [align] [width]]

例

#include <print>
#include <stacktrace>

void g() {
  std::stacktrace st = std::stacktrace::current(0, 1);
  std::stacktrace_entry entry = st[0];

  std::println("{}", entry);
  std::println("{: >30}", entry);
}

void f() {
  g();
}

int main() {
  f();
}

出力

 g() at /app/example.cpp:5
     g() at /app/example.cpp:5

バージョン

言語

  • C++23

処理系

  • Clang: ??
  • GCC: 14 ✅
  • Visual C++: ??

関連項目

  • std::format() (フォーマットの詳細)

参照

  • P2693R1 Formatting thread::id and stacktrace
You are visitor 01402520 — 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.