| 60 | |
| 61 | #include <iostream> |
| 62 | int main() { |
| 63 | |
| 64 | //[getting_started_catching_trace |
| 65 | try { |
| 66 | foo(5); // testing assert handler |
| 67 | } catch (const std::exception& e) { |
| 68 | std::cerr << e.what() << '\n'; |
| 69 | const boost::stacktrace::stacktrace* st = boost::get_error_info<traced>(e); |
| 70 | if (st) { |
| 71 | std::cerr << *st << '\n'; /*<-*/ return 0; /*->*/ |
| 72 | } /*<-*/ return 3; /*->*/ |
| 73 | } |
| 74 | //] |
| 75 | |
| 76 | return 5; |
| 77 | } |
| 78 |