fix minitoc/heading error
[vspell.git] / libvspell / boost / checked_delete.hpp
blobabb2ce03a2fedb48691f3ddbcca7137c7036ddb2
1 #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
2 #define BOOST_CHECKED_DELETE_HPP_INCLUDED
4 #if _MSC_VER >= 1020
5 #pragma once
6 #endif
8 //
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.
19 namespace boost
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)];
27 delete x;
30 template< typename T > inline void checked_array_delete(T * x)
32 typedef char type_must_be_complete[sizeof(T)];
33 delete [] x;
36 template<class T> struct checked_deleter
38 typedef void result_type;
39 typedef T * argument_type;
41 void operator()(T * x)
43 checked_delete(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);
58 } // namespace boost
60 #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED