Blaze  3.6
DefaultDelete.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_POLICIES_DEFAULTDELETE_H_
36 #define _BLAZE_UTIL_POLICIES_DEFAULTDELETE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 
45 
46 namespace blaze {
47 
48 //=================================================================================================
49 //
50 // CLASS DEFINITION
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
74 template< typename Type >
76 {
77  //**Utility functions***************************************************************************
80  inline void operator()( Type* ptr ) const;
82  //**********************************************************************************************
83 };
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
98 template< typename Type >
99 inline void DefaultDelete<Type>::operator()( Type* ptr ) const
100 {
101  checkedDelete( ptr );
102 }
103 //*************************************************************************************************
104 
105 
106 
107 
108 //=================================================================================================
109 //
110 // SPECIALIZATION FOR ARRAYS
111 //
112 //=================================================================================================
113 
114 //*************************************************************************************************
122 template< typename Type >
123 struct DefaultDelete<Type[]>
124 {
125  //**Utility functions***************************************************************************
128  inline void operator()( Type* ptr ) const;
130  //**********************************************************************************************
131 };
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
148 template< typename Type >
149 inline void DefaultDelete<Type[]>::operator()( Type* ptr ) const
150 {
151  checkedArrayDelete( ptr );
152 }
154 //*************************************************************************************************
155 
156 } // namespace blaze
157 
158 #endif
Default C++ deletion policy class.The DefaultDelete deletion policy is the standard delete for resour...
Definition: DefaultDelete.h:75
void checkedDelete(T *ptr)
Type-checked delete operation.
Definition: CheckedDelete.h:69
void checkedArrayDelete(T *ptr)
Type-checked delete[] operation.
Definition: CheckedDelete.h:91
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Type-checked delete operations.
void operator()(Type *ptr) const
Implementation of the default delete policy.
Definition: DefaultDelete.h:99