Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
IsResizable.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TYPETRAITS_ISRESIZABLE_H_
36
#define _BLAZE_MATH_TYPETRAITS_ISRESIZABLE_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <utility>
44
#include <
blaze/math/typetraits/IsMatrix.h
>
45
#include <
blaze/math/typetraits/IsVector.h
>
46
#include <
blaze/math/typetraits/RemoveAdaptor.h
>
47
#include <
blaze/util/IntegralConstant.h
>
48
#include <
blaze/util/typetraits/IsDetected.h
>
49
#include <
blaze/util/Types.h
>
50
51
52
namespace
blaze {
53
54
//=================================================================================================
55
//
56
// CLASS DEFINITION
57
//
58
//=================================================================================================
59
60
//*************************************************************************************************
65
template
<
typename
T >
66
using
Resizable1_t =
decltype
( std::declval<T&>().resize( std::declval<size_t>() ) );
68
//*************************************************************************************************
69
70
71
//*************************************************************************************************
76
template
<
typename
T >
77
using
Resizable2_t =
decltype
( std::declval<T&>().resize( std::declval<size_t>(), std::declval<size_t>() ) );
79
//*************************************************************************************************
80
81
82
//*************************************************************************************************
101
template
<
typename
T >
102
struct
IsResizable
103
:
public
BoolConstant
< ( IsVector_v<T> && IsDetected_v< Resizable1_t, RemoveAdaptor_t<T> > ) ||
104
( IsMatrix_v<T> && IsDetected_v< Resizable2_t, RemoveAdaptor_t<T> > ) >
105
{};
106
//*************************************************************************************************
107
108
109
//*************************************************************************************************
114
template
<
typename
T >
115
struct
IsResizable
<T&>
116
:
public
FalseType
117
{};
119
//*************************************************************************************************
120
121
122
//*************************************************************************************************
135
template
<
typename
T >
136
constexpr
bool
IsResizable_v
=
IsResizable<T>::value
;
137
//*************************************************************************************************
138
139
}
// namespace blaze
140
141
#endif
IntegralConstant.h
Header file for the IntegralConstant class template.
IsDetected.h
Header file for the IsDetected type trait.
IsMatrix.h
Header file for the IsMatrix type trait.
IsVector.h
Header file for the IsVector type trait.
RemoveAdaptor.h
Header file for the RemoveAdaptor type trait.
blaze::IsResizable_v
constexpr bool IsResizable_v
Auxiliary variable template for the IsResizable type trait.
Definition
IsResizable.h:136
blaze::FalseType
BoolConstant< false > FalseType
Type/value traits base class.
Definition
IntegralConstant.h:121
blaze::BoolConstant
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition
IntegralConstant.h:110
blaze::IsResizable
Compile time check for resizable data types.
Definition
IsResizable.h:105
Types.h
Header file for basic type definitions.
Generated by
1.18.0