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

履歴 編集

function
<stacktrace>

std::stacktrace_entry::to_string(C++23)

namespace std {
  string to_string(const stacktrace_entry& f);
}

概要

文字列化する。

戻り値

fのスタックトレースエントリ情報を説明する文字列を返す。

備考

#include <iostream>
#include <stacktrace>

void g() {
  std::string entry = std::to_string(std::stacktrace::current()[0]);
  std::cout << entry << std::endl;
}

void f() {
  g();
}

int main() {
  f();
}

出力例 (GCC)

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

バージョン

言語

  • C++23

処理系