xrpld
Loading...
Searching...
No Matches
include
xrpl
basics
ToString.h
1
#pragma once
2
3
#include <
string
>
4
#include <
type_traits
>
5
6
namespace
xrpl
{
7
14
15
template
<
class
T>
16
std::string
17
to_string
(T t)
// NOLINT(readability-identifier-naming)
18
requires
(
std::is_arithmetic_v<T>
)
19
{
20
return
std::to_string
(t);
21
}
22
23
inline
std::string
24
to_string
(
bool
b)
// NOLINT(readability-identifier-naming)
25
{
26
return
b ?
"true"
:
"false"
;
27
}
28
29
inline
std::string
30
to_string
(
char
c)
// NOLINT(readability-identifier-naming)
31
{
32
return
std::string
(1, c);
33
}
34
35
inline
std::string
36
to_string
(
std::string
s)
// NOLINT(readability-identifier-naming)
37
{
38
return
s;
39
}
40
41
inline
std::string
42
to_string
(
char
const
* s)
// NOLINT(readability-identifier-naming)
43
{
44
return
s;
45
}
46
47
}
// namespace xrpl
std::string
std::is_arithmetic_v
T is_arithmetic_v
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::to_string
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition
base_uint.h:651
string
std::to_string
T to_string(T... args)
type_traits
Generated by
1.16.1