All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DefaultDelete.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_POLICIES_DEFAULTDELETE_H_
23 #define _BLAZE_UTIL_POLICIES_DEFAULTDELETE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <boost/checked_delete.hpp>
31 
32 
33 namespace blaze {
34 
35 //=================================================================================================
36 //
37 // CLASS DEFINITION
38 //
39 //=================================================================================================
40 
41 //*************************************************************************************************
61 template< typename Type >
63 {
64  //**Utility functions***************************************************************************
67  inline void operator()( Type* ptr ) const;
69  //**********************************************************************************************
70 };
71 //*************************************************************************************************
72 
73 
74 //*************************************************************************************************
85 template< typename Type >
86 inline void DefaultDelete<Type>::operator()( Type* ptr ) const
87 {
88  boost::checked_delete( ptr );
89 }
90 //*************************************************************************************************
91 
92 
93 
94 
95 //=================================================================================================
96 //
97 // SPECIALIZATION FOR ARRAYS
98 //
99 //=================================================================================================
100 
101 //*************************************************************************************************
109 template< typename Type >
110 struct DefaultDelete<Type[]>
111 {
112  //**Utility functions***************************************************************************
115  inline void operator()( Type* ptr ) const;
117  //**********************************************************************************************
118 };
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
135 template< typename Type >
136 inline void DefaultDelete<Type[]>::operator()( Type* ptr ) const
137 {
138  boost::checked_array_delete( ptr );
139 }
141 //*************************************************************************************************
142 
143 } // namespace blaze
144 
145 #endif