1// Copyright Antony Polukhin, 2016-2024.
2//
3// Distributed under the Boost Software License, Version 1.0. (See
4// accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
8#define BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
9
10#include <boost/config.hpp>
11#ifdef BOOST_HAS_PRAGMA_ONCE
12# pragma once
13#endif
14
15#include <boost/stacktrace/frame.hpp>
16
17namespace boost { namespace stacktrace { namespace detail {
18
19struct to_string_using_nothing {
20 std::string res;
21
22 void prepare_function_name(const void* addr) {
23 res = boost::stacktrace::frame(addr).name();
24 }
25
26 bool prepare_source_location(const void* /*addr*/) const noexcept {
27 return false;
28 }
29};
30
31template <class Base> class to_string_impl_base;
32typedef to_string_impl_base<to_string_using_nothing> to_string_impl;
33
34inline std::string name_impl(const void* /*addr*/) {
35 return std::string();
36}
37
38} // namespace detail
39
40std::string frame::source_file() const {
41 return std::string();
42}
43
44std::size_t frame::source_line() const {
45 return 0;
46}
47
48}} // namespace boost::stacktrace
49
50#endif // BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
51

source code of boost/libs/stacktrace/include/boost/stacktrace/detail/unwind_base_impls.hpp