Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
test
type_traits_old.h
Go to the documentation of this file.
1
#ifndef fhiclcpp_test_type_traits_old_h
2
#define fhiclcpp_test_type_traits_old_h
3
4
// ======================================================================
5
//
6
// type traits
7
//
8
// ======================================================================
9
10
#include <complex>
11
#include <type_traits>
12
13
// ======================================================================
14
15
namespace
tt_old
{
16
using
std::is_floating_point;
17
18
using
std::enable_if;
19
20
template
<
bool
b,
typename
T =
void
>
21
using
disable_if
= std::enable_if<!b, T>;
22
template
<
class
>
23
struct
is_complex
;
24
template
<
class
>
25
struct
is_int
;
26
template
<
class
>
27
struct
is_numeric
;
28
template
<
class
>
29
struct
is_uint
;
30
}
31
32
// ======================================================================
33
34
namespace
tt_old
{
35
template
<
class
T>
36
struct
is_complex
:
public
std::false_type {};
37
38
template
<
class
T>
39
struct
is_complex
<
std
::complex<T>> :
public
is_floating_point<T> {};
40
}
41
42
// ----------------------------------------------------------------------
43
44
namespace
tt_old
{
45
template
<
class
T>
46
struct
is_int
:
public
std::false_type {};
47
template
<
class
T>
48
struct
is_int
<
T
const
> :
public
is_int
<T> {};
49
50
template
<>
51
struct
is_int
<signed char> :
public
std::true_type {};
52
template
<>
53
struct
is_int
<short> :
public
std::true_type {};
54
template
<>
55
struct
is_int
<
int
> :
public
std::true_type {};
56
template
<>
57
struct
is_int
<long> :
public
std::true_type {};
58
}
59
60
// ----------------------------------------------------------------------
61
62
namespace
tt_old
{
63
template
<
class
T>
64
struct
is_uint
:
public
std::false_type {};
65
template
<
class
T>
66
struct
is_uint
<
T
const
> :
public
is_uint
<T> {};
67
68
template
<>
69
struct
is_uint
<unsigned char> :
public
std::true_type {};
70
template
<>
71
struct
is_uint
<unsigned short> :
public
std::true_type {};
72
template
<>
73
struct
is_uint
<unsigned
int
> :
public
std::true_type {};
74
template
<>
75
struct
is_uint
<unsigned long> :
public
std::true_type {};
76
}
77
78
// ----------------------------------------------------------------------
79
80
namespace
tt_old
{
81
template
<
class
T>
82
struct
is_numeric
83
:
public
std::integral_constant<bool,
84
is_int<T>::value || is_uint<T>::value ||
85
is_floating_point<T>::value> {};
86
}
87
88
// ======================================================================
89
90
#endif
/* fhiclcpp_test_type_traits_old_h */
91
92
// Local Variables:
93
// mode: c++
94
// End:
freeze_graph.const
const
Definition:
freeze_graph.py:179
tt_old::is_int
Definition:
type_traits_old.h:25
ValidateOpDetSimulation.T
T
Definition:
ValidateOpDetSimulation.py:52
std
STL namespace.
tt_old::is_uint
Definition:
type_traits_old.h:29
tt_old
Definition:
type_traits_old.h:15
tt_old::is_numeric
Definition:
type_traits_old.h:27
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
tt_old::is_complex
Definition:
type_traits_old.h:23
tt_old::disable_if
std::enable_if<!b, T > disable_if
Definition:
type_traits_old.h:21
Generated by
1.8.11