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