1 #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
2 #define BOOST_CHECKED_DELETE_HPP_INCLUDED
9 // boost/checked_delete.hpp
11 // Copyright (c) 1999, 2000, 2001, 2002 boost.org
13 // Permission to copy, use, modify, sell and distribute this software
14 // is granted provided this copyright notice appears in all copies.
15 // This software is provided "as is" without express or implied
16 // warranty, and with no claim as to its suitability for any purpose.
22 // verify that types are complete for increased safety
24 template< typename T
> inline void checked_delete(T
* x
)
26 typedef char type_must_be_complete
[sizeof(T
)];
30 template< typename T
> inline void checked_array_delete(T
* x
)
32 typedef char type_must_be_complete
[sizeof(T
)];
36 template<class T
> struct checked_deleter
38 typedef void result_type
;
39 typedef T
* argument_type
;
41 void operator()(T
* x
)
47 template<class T
> struct checked_array_deleter
49 typedef void result_type
;
50 typedef T
* argument_type
;
52 void operator()(T
* x
)
54 checked_array_delete(x
);
60 #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED