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

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

最終更新日時: 2026年10月03日 22時31分04秒 (JST)
Akira Takahashi が更新

履歴 編集

function
<stacktrace>

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

const_reference at(size_type frame_no) const; // (1) C++23

概要

任意の位置の要素を取得する。

戻り値

保持しているスタックトレースの履歴の、frame_no番目の要素を返す。

例外

frame_no >= size()である場合、std::out_of_range例外を送出する。

例

#include <iostream>
#include <stacktrace>

void g() {
  std::stacktrace st = std::stacktrace::current();
  std::cout << st.at(0) << std::endl;
}

void f() {
  g();
}

int main() {
  f();
}

出力例 (GCC)

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

バージョン

言語

  • C++23

処理系

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