AlignmentCheck.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_ALIGNMENTCHECK_H_
36 #define _BLAZE_UTIL_ALIGNMENTCHECK_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Types.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // SIZETRAIT CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
67 template< typename T >
68 bool checkAlignment( const T* address )
69 {
70  return !( reinterpret_cast<size_t>( address ) % AlignmentOf<T>::value );
71 }
72 //*************************************************************************************************
73 
74 } // namespace blaze
75 
76 #endif
Header file for the AlignmentOf type trait.
Header file for basic type definitions.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
bool checkAlignment(const T *address)
Checks the alignment of the given.
Definition: AlignmentCheck.h:68
Evaluation of the required alignment of the given data type.The AlignmentOf type trait template evalu...
Definition: AlignmentOf.h:77