Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 1.1 KB

File metadata and controls

61 lines (48 loc) · 1.1 KB

cend

  • stacktrace[meta header]
  • std[meta namespace]
  • basic_stacktrace[meta class]
  • function[meta id-type]
  • cpp23[meta cpp]
const_iterator cend() const noexcept; // (1) C++23

概要

末尾の次を指す読み取り専用イテレータを取得する。

戻り値

スタックトレース履歴の末尾の次を指す読み取り専用イテレータを返す。

#include <iostream>
#include <stacktrace>
#include <algorithm>

void g() {
  std::stacktrace st = std::stacktrace::current();
  std::for_each(st.cbegin(), st.cend(), [](const std::stacktrace_entry& x) {
    std::cout << x << std::endl;
  }):
}

void f() {
  g();
}

int main() {
  f();
}
  • st.cend()[color ff0000]
  • st.cbegin()[link cbegin.md]
  • current()[link current.md]
  • std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md]

出力

g() at main.cpp:6
f() at main.cpp:13
main at main.cpp:17

バージョン

言語

  • C++23

処理系