ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
irept.h
Go to the documentation of this file.
1
// LOOK AT <util/message/format.h> FOR MORE INFO ABOUT
2
// WHAT THIS FILE IS ABOUT!!!
3
4
#ifndef ESBMC_FORMATS_START_ASSERTION
5
# error Do not include this header directly, use <util/message/format.h>
6
#endif
7
8
// irept Specialization
9
#include <
util/irep/irep.h
>
10
template
<>
11
struct
fmt::formatter<
irept
>
12
{
13
// irept does not support any specific format
14
constexpr
auto
parse
(format_parse_context &ctx)
15
{
16
auto
it = ctx.begin(), end = ctx.end();
17
if
(it != end && *it !=
'}'
)
18
throw
format_error(
"invalid format"
);
19
return
it;
20
}
21
22
// This will teach fmt how to convert irept into a str.
23
template
<
typename
FormatContext>
24
auto
format
(
const
irept
&p, FormatContext &ctx)
const
25
{
26
return
fmt::format_to(ctx.out(),
"{}"
, p.pretty(0));
27
}
28
};
irept
Definition
irep.h:36
irep.h
fmt::formatter< irept >::format
auto format(const irept &p, FormatContext &ctx) const
Definition
irept.h:24
fmt::formatter< irept >::parse
constexpr auto parse(format_parse_context &ctx)
Definition
irept.h:14
src
util
message
formats
irept.h
Generated by
1.15.0