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

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

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

履歴 編集

function
<stacktrace>

std::basic_stacktrace::operator<<(C++23)

namespace std {
  template <class Allocator>
  ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
}

概要

出力ストリームに出力する。

効果

以下と等価:

return os << to_string(st);

例

#include <iostream>
#include <stacktrace>

void g() {
  std::cout << std::stacktrace::current() << std::endl;
}

void f() {
  g();
}

int main() {
  f();
}

出力例 (GCC)

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

バージョン

言語

  • C++23

処理系

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

参照

  • LWG Issue 3515. [stacktrace.basic.nonmem]: operator<< should be less templatized
    • C++23で、operator<<がcharT/traitsでテンプレート化されたbasic_ostream<charT, traits>ではなく、非テンプレートのostreamを受け取り返すよう変更された
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.