1 #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
2 #define BOOST_CHECKED_DELETE_HPP_INCLUDED
4 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
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 // Intel 7 accepts sizeof(incomplete) as 0 in system headers
30 typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
34 template<class T> inline void checked_array_delete(T * x)
36 typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
40 template<class T> struct checked_deleter
42 typedef void result_type;
43 typedef T * argument_type;
45 void operator()(T * x) const
47 // boost:: disables ADL
48 boost::checked_delete(x);
52 template<class T> struct checked_array_deleter
54 typedef void result_type;
55 typedef T * argument_type;
57 void operator()(T * x) const
59 boost::checked_array_delete(x);
65 #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED