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

  1. リファレンス
  2. stacktrace
  3. basic_stacktrace
  4. to_string

最終更新日時: 2026年07月22日 16時08分23秒 (JST)
rotarymars が更新

履歴 編集

function
<stacktrace>

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

namespace std {
  template <class Allocator>
  string to_string(const basic_stacktrace<Allocator>& st);
}

概要

文字列化する。

戻り値

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

備考

  • 戻り値となる文字列の行数は、size()と等値であるという保証はない

例

#include <iostream>
#include <stacktrace>
#include <string>

void g() {
  std::string trace = std::to_string(std::stacktrace::current());
  std::cout << trace << std::endl;
}

void f() {
  g();
}

int main() {
  f();
}

出力例 (GCC)

   0#  g() at /app/example.cpp:5
   1#  f() at /app/example.cpp:10
   2# main at /app/example.cpp:14
   3#      at :0
   4#      at :0
   5# _start at :0
   6# 

バージョン

言語

  • C++23

処理系

  • Clang: ??
  • GCC: 12 ✅
  • Visual C++: ??
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.