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