+}
+Backtrace::Backtrace(const Backtrace& bt)
+{
+ impl_ = bt.impl_;
+ if (impl_)
+ impl_->ref();
+}
+
+Backtrace::~Backtrace()
+{
+ if (impl_ != nullptr && impl_->unref()) {
+ delete impl_;
+ }
+}
+
+std::string const Backtrace::resolve() const
+{
+ std::string result("");
+
+#if HAVE_BOOST_STACKTRACE
+ std::stringstream ss;
+ ss << impl_->st;
+ result.append(ss.str());
+#endif
+ return result;
+}
+
+void Backtrace::display() const
+{
+ std::string backtrace = resolve();
+ if (backtrace.empty()) {
+ fprintf(stderr, "(backtrace not set -- did you install Boost.Stacktrace?)\n");
+ return;
+ }
+ fprintf(stderr, "Backtrace (displayed in actor %s):\n", SIMIX_process_self_get_name());
+ std::fprintf(stderr, "%s\n", backtrace.c_str());
+}
+
+} // namespace xbt
+} // namespace simgrid