xtd 0.2.0
Loading...
Searching...
No Matches
stack_trace.cpp

Shows how to use xtd::diagnostics::stack_trace class.

#include <xtd/diagnostics/stack_trace>
#include <xtd/console>
#include <xtd/startup>
using namespace xtd;
using namespace xtd::diagnostics;
namespace stack_trace_example {
class main_class {
static void method3() {
console::write_line("stack_trace:");
console::write_line(stack_trace {});
}
static void method2() {
method3();
}
static void method1() {
method2();
}
public:
static void main() {
method1();
}
};
}
startup_(stack_trace_example::main_class::main);
// This code produces the following output :
//
// stack_trace:
// at stack_trace_example::main_class::method3()
// at stack_trace_example::main_class::method2()
// at stack_trace_example::main_class::method1()
// at stack_trace_example::main_class::main()
// at main
Represents a stack trace, which is an ordered collection of one or more stack frames.
Definition stack_trace.h:39
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:166
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.h:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10