preCICE
v3.1.2
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
Typedefs
b
d
e
g
l
m
p
r
s
t
u
v
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
i
k
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
c
d
e
i
l
m
n
o
r
s
u
v
w
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
j
m
n
o
p
r
s
t
v
Functions
a
b
c
g
m
p
r
s
t
v
Variables
Typedefs
Macros
b
d
f
m
n
p
t
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
src
utils
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
16
namespace
precice::utils
{
17
18
// pass through for string only
19
inline
std::string
format_or_error
(
std::string_view
str)
20
{
21
return
std::string
{str};
22
}
19
inline
std::string
format_or_error
(
std::string_view
str) {
…
}
23
24
template
<
class
... A>
25
std::string
format_or_error
(
std::string_view
fmt, A &&... args)
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
}
25
std::string
format_or_error
(
std::string_view
fmt, A &&... args) {
…
}
33
34
}
// namespace precice::utils
std::string
std::string_view
fmtEigen.hpp
fmtSTL.hpp
precice::utils
contains precice-related utilities.
Definition
PointToPointCommunicationTest.cpp:23
precice::utils::format_or_error
std::string format_or_error(std::string_view str)
Definition
fmt.hpp:19
string
string_view