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
12 // Copyright (c) 2002, 2003 Peter Dimov
14 // Permission to copy, use, modify, sell and distribute this software
15 // is granted provided this copyright notice appears in all copies.
16 // This software is provided "as is" without express or implied
17 // warranty, and with no claim as to its suitability for any purpose.
19 // See http://www.boost.org/libs/utility/checked_delete.html for documentation.
25 // verify that types are complete for increased safety
27 template<class T> inline void checked_delete(T * x)
29 typedef char type_must_be_complete[sizeof(T)];
33 template<class T> inline void checked_array_delete(T * x)
35 typedef char type_must_be_complete[sizeof(T)];
39 template<class T> struct checked_deleter
41 typedef void result_type;
42 typedef T * argument_type;
44 void operator()(T * x) const
46 boost::checked_delete(x);
50 template<class T> struct checked_array_deleter
52 typedef void result_type;
53 typedef T * argument_type;
55 void operator()(T * x) const
57 boost::checked_array_delete(x);
63 #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED