Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
print.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
19#include <string_view>
20
21namespace shambase {
22
28 void print(std::string_view sv);
29
35 void println(std::string_view sv);
36
43 void flush();
44
55 void change_printer(
56 void (*func_printer_normal)(std::string_view),
57 void (*func_printer_ln)(std::string_view),
58 void (*func_flush_func)());
59
66 void reset_std_behavior();
67
68} // namespace shambase
namespace for basic c++ utilities
void println(std::string_view sv)
Prints a string to the console followed by a newline.
Definition print.cpp:37
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
void print(std::string_view sv)
Prints a string to the console.
Definition print.cpp:30
void flush()
Flushes the output buffer.
Definition print.cpp:44
void reset_std_behavior()
Restores the default behavior of the print and println functions.
Definition print.cpp:61
void change_printer(void(*func_printer_normal)(std::string_view), void(*func_printer_ln)(std::string_view), void(*func_flush_func)())
Changes the behavior of the print, println and flush functions.
Definition print.cpp:52