r/cpp • • Apr 16 '26

C++23 std::stacktrace: Never Debug Blind Again

https://medium.com/@sagar.necindia/c-23-std-stacktrace-never-debug-blind-again-6625924d520c
75 Upvotes

48 comments sorted by

View all comments

Show parent comment

1

u/jwakely libstdc++ tamer, LWG chair Apr 17 '26

It should be entirely agnostic to threads. You call std::stacktrace::current() to get a stacktrace of the current thread. Whether there are other threads should be entirely irrelevant, except that maybe the stacktrace won't start with main if it's in a different thread.