Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SourceLocation.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
20#include <string>
21
31
33
34 srcloc loc;
35
36 inline explicit SourceLocation(srcloc _loc = srcloc::current()) : loc(_loc) {}
37
43 std::string format_multiline() const;
44
51 std::string format_multiline(std::string stacktrace) const;
52
58 std::string format_one_line() const;
59
65 std::string format_one_line_func() const;
66};
provide information about the source location
std::string format_one_line_func() const
format the location in a one liner with the function name displayed
std::string format_multiline() const
format the location in multiple lines
std::string format_one_line() const
format the location in a one liner
Utility class to emulates std::source_location class introduced in c++20 This class provides informat...
static constexpr source_location current() noexcept
Returns the source location where this function is called.