Blaze 3.9
DefaultProxy.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_PROXY_DEFAULTPROXY_H_
36#define _BLAZE_MATH_PROXY_DEFAULTPROXY_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/system/Inline.h>
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// CLASS DEFINITION
51//
52//=================================================================================================
53
54//*************************************************************************************************
62template< typename PT // Type of the proxy
63 , typename RT > // Type of the represented element
65{
66 public:
67 //**Conversion operators************************************************************************
70 [[deprecated]] BLAZE_ALWAYS_INLINE PT& operator~() noexcept;
71 [[deprecated]] BLAZE_ALWAYS_INLINE const PT& operator~() const noexcept;
72
73 BLAZE_ALWAYS_INLINE PT& operator*() noexcept;
74 BLAZE_ALWAYS_INLINE const PT& operator*() const noexcept;
76 //**********************************************************************************************
77
78 protected:
79 //**Special member functions********************************************************************
82 DefaultProxy() = default;
83 DefaultProxy( const DefaultProxy& ) = default;
84 DefaultProxy( DefaultProxy&& ) = default;
85 ~DefaultProxy() = default;
86 DefaultProxy& operator=( const DefaultProxy& ) = default;
87 DefaultProxy& operator=( DefaultProxy&& ) = default;
89 //**********************************************************************************************
90};
91//*************************************************************************************************
92
93
94
95
96//=================================================================================================
97//
98// CONVERSION OPERATORS
99//
100//=================================================================================================
101
102//*************************************************************************************************
110template< typename PT // Type of the proxy
111 , typename RT > // Type of the represented element
113{
114 return static_cast<PT&>( *this );
115}
116//*************************************************************************************************
117
118
119//*************************************************************************************************
127template< typename PT // Type of the proxy
128 , typename RT > // Type of the represented element
129[[deprecated]] BLAZE_ALWAYS_INLINE const PT& DefaultProxy<PT,RT>::operator~() const noexcept
130{
131 return static_cast<const PT&>( *this );
132}
133//*************************************************************************************************
134
135
136//*************************************************************************************************
144template< typename PT // Type of the proxy
145 , typename RT > // Type of the represented element
147{
148 return static_cast<PT&>( *this );
149}
150//*************************************************************************************************
151
152
153//*************************************************************************************************
161template< typename PT // Type of the proxy
162 , typename RT > // Type of the represented element
164{
165 return static_cast<const PT&>( *this );
166}
167//*************************************************************************************************
168
169
170
171
172//=================================================================================================
173//
174// GLOBAL FUNCTIONS
175//
176//=================================================================================================
177
178//*************************************************************************************************
181template< typename PT, typename RT >
182PT& crtp_cast( DefaultProxy<PT,RT>& proxy );
183
184template< typename PT, typename RT >
185const PT& crtp_cast( const DefaultProxy<PT,RT>& proxy );
187//*************************************************************************************************
188
189
190//*************************************************************************************************
199template< typename PT // Type of the proxy
200 , typename RT > // Type of the represented element
202{
203 return *proxy;
204}
205//*************************************************************************************************
206
207
208//*************************************************************************************************
217template< typename PT // Type of the proxy
218 , typename RT > // Type of the represented element
220{
221 return *proxy;
222}
223//*************************************************************************************************
224
225} // namespace blaze
226
227#endif
Default proxy backend for built-in and alternate user-specific class types.
Definition: DefaultProxy.h:65
BLAZE_ALWAYS_INLINE PT & operator~() noexcept
Conversion operator for non-constant proxies.
Definition: DefaultProxy.h:112
BLAZE_ALWAYS_INLINE PT & operator*() noexcept
Conversion operator for non-constant proxies.
Definition: DefaultProxy.h:146
MT & crtp_cast(Matrix< MT, SO > &matrix)
CRTP-based conversion operation for non-constant matrices.
Definition: Matrix.h:479
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.