preCICE v3.1.2
Loading...
Searching...
No Matches
fmt.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <string>
9#include <string_view>
10
11#include "fmt/format.h"
12#include "fmt/ostream.h"
13#include "utils/fmtEigen.hpp"
14#include "utils/fmtSTL.hpp"
15
16namespace precice::utils {
17
18// pass through for string only
20{
21 return std::string{str};
22}
23
24template <class... A>
26{
27 try {
28 return fmt::vformat(fmt, fmt::make_format_args(args...));
29 } catch (const fmt::format_error &e) {
30 return std::string{"fmt_error: "} + e.what();
31 }
32}
33
34} // namespace precice::utils
contains precice-related utilities.
std::string format_or_error(std::string_view str)
Definition fmt.hpp:19