-Backtrace::Backtrace()
-{
-#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
- impl_ = new BacktraceImpl();
- impl_->st = boost::stacktrace::stacktrace();
-#endif
-}
-
-Backtrace::Backtrace(const Backtrace& bt) : impl_(bt.impl_)
-{
- if (impl_)
- impl_->ref();
-}
-
-Backtrace::Backtrace(Backtrace&& bt)
-{
- std::swap(impl_, bt.impl_);
-}
-
-Backtrace& Backtrace::operator=(const Backtrace& rhs)
-{
- if (this != &rhs) {
- if (impl_)
- impl_->unref();
- impl_ = rhs.impl_;
- if (impl_)
- impl_->ref();
- }
- return *this;
-}
-
-Backtrace& Backtrace::operator=(Backtrace&& rhs)
-{
- if (this != &rhs) {
- if (impl_)
- impl_->unref();
- impl_ = rhs.impl_;
- rhs.impl_ = nullptr;
- }
- return *this;
-}