rippled
Loading...
Searching...
No Matches
include
xrpl
beast
type_name.h
1
#ifndef BEAST_TYPE_NAME_H_INCLUDED
2
#define BEAST_TYPE_NAME_H_INCLUDED
3
4
#include <
cstdlib
>
5
#include <
string
>
6
#include <
type_traits
>
7
#include <
typeinfo
>
8
9
#ifndef _MSC_VER
10
#include <cxxabi.h>
11
#endif
12
13
namespace
beast
{
14
15
template
<
typename
T>
16
std::string
17
type_name
()
18
{
19
using
TR =
typename
std::remove_reference<T>::type
;
20
21
std::string
name =
typeid
(TR).name();
22
23
#ifndef _MSC_VER
24
if
(
auto
s = abi::__cxa_demangle(name.
c_str
(),
nullptr
,
nullptr
,
nullptr
))
25
{
26
name = s;
27
std::free
(s);
28
}
29
#endif
30
31
if
(
std::is_const<TR>::value
)
32
name +=
" const"
;
33
if
(
std::is_volatile<TR>::value
)
34
name +=
" volatile"
;
35
if
(
std::is_lvalue_reference<T>::value
)
36
name +=
"&"
;
37
else
if
(
std::is_rvalue_reference<T>::value
)
38
name +=
"&&"
;
39
40
return
name;
41
}
42
43
}
// namespace beast
44
45
#endif
std::string
std::string::c_str
T c_str(T... args)
cstdlib
std::free
T free(T... args)
std::is_const
std::is_lvalue_reference
std::is_rvalue_reference
std::is_volatile
beast
Definition
base_uint.h:653
beast::type_name
std::string type_name()
Definition
type_name.h:17
std::remove_reference
string
type_traits
typeinfo
Generated by
1.9.8