Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
DynamicAllocator.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TYPETRAITS_DYNAMICALLOCATOR_H_
36
#define _BLAZE_MATH_TYPETRAITS_DYNAMICALLOCATOR_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <memory>
44
#include <
blaze/util/AlignedAllocator.h
>
45
#include <
blaze/util/NullAllocator.h
>
46
47
48
namespace
blaze {
49
50
//=================================================================================================
51
//
52
// CLASS DEFINITION
53
//
54
//=================================================================================================
55
56
//*************************************************************************************************
93
template
<
typename
A1,
typename
... As >
94
struct
DynamicAllocator
95
{
96
public
:
97
//**********************************************************************************************
99
template
<
typename
U >
100
using
Type
=
NullAllocator<U>
;
102
//**********************************************************************************************
103
};
104
//*************************************************************************************************
105
106
107
//*************************************************************************************************
112
template
<
typename
T >
113
struct
DynamicAllocator
<
AlignedAllocator
<T> >
114
{
115
template
<
typename
U >
116
using
Type
=
AlignedAllocator<U>
;
117
};
119
//*************************************************************************************************
120
121
122
//*************************************************************************************************
127
template
<
typename
T >
128
struct
DynamicAllocator< NullAllocator<T> >
129
{
130
template
<
typename
U >
131
using
Type = AlignedAllocator<U>;
132
};
134
//*************************************************************************************************
135
136
137
//*************************************************************************************************
142
template
<
typename
T1,
typename
T2 >
143
struct
DynamicAllocator
<
AlignedAllocator
<T1>,
AlignedAllocator
<T2> >
144
{
145
template
<
typename
U >
146
using
Type = AlignedAllocator<U>;
147
};
149
//*************************************************************************************************
150
151
152
//*************************************************************************************************
157
template
<
typename
A1,
typename
T2 >
158
struct
DynamicAllocator
< A1,
NullAllocator
<T2> >
159
{
160
template
<
typename
U >
161
using
Type =
typename
std::allocator_traits<A1>::template rebind_alloc<U>;
162
};
164
//*************************************************************************************************
165
166
167
//*************************************************************************************************
172
template
<
typename
A2,
typename
T1 >
173
struct
DynamicAllocator
<
NullAllocator
<T1>, A2 >
174
{
175
template
<
typename
U >
176
using
Type =
typename
std::allocator_traits<A2>::template rebind_alloc<U>;
177
};
179
//*************************************************************************************************
180
181
182
//*************************************************************************************************
187
template
<
typename
T1,
typename
T2 >
188
struct
DynamicAllocator
<
NullAllocator
<T1>,
NullAllocator
<T2> >
189
{
190
template
<
typename
U >
191
using
Type = AlignedAllocator<U>;
192
};
194
//*************************************************************************************************
195
196
197
//*************************************************************************************************
210
template
<
typename
T,
typename
... As >
211
using
DynamicAllocator_t
=
typename
DynamicAllocator
<As...>::template
Type<T>
;
212
//*************************************************************************************************
213
214
}
// namespace blaze
215
216
#endif
AlignedAllocator.h
Header file for the AlignedAllocator implementation.
NullAllocator.h
Header file for the NullAllocator implementation.
blaze::AlignedAllocator
Allocator for type-specific aligned memory.
Definition
AlignedAllocator.h:72
blaze::NullAllocator
Allocator returning nullptr.
Definition
NullAllocator.h:66
blaze::Type
blaze::DynamicAllocator_t
typename DynamicAllocator< As... >::template Type< T > DynamicAllocator_t
Auxiliary alias declaration for the DynamicAllocator type trait.
Definition
DynamicAllocator.h:211
blaze::DynamicAllocator
Deduction of an allocator type for dynamic vectors and matrices.
Definition
DynamicAllocator.h:95
Generated by
1.18.0