diff --git a/checked_delete_test.cpp b/checked_delete_test.cpp new file mode 100644 index 0000000..f9107c8 --- /dev/null +++ b/checked_delete_test.cpp @@ -0,0 +1,31 @@ +// Boost checked_delete test program ---------------------------------------// + +// (C) Copyright Beman Dawes 2001. Permission to copy, use, modify, sell +// and distribute this software is granted provided this copyright +// notice appears in all copies. This software is provided "as is" without +// express or implied warranty, and with no claim as to its suitability for +// any purpose. + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 21 May 01 Initial version (Beman Dawes) + +#include // for checked_delete + +// This program demonstrates compiler errors when trying to delete an +// incomplete type. + +namespace +{ + class Incomplete; +} + +int main() +{ + Incomplete * p; + boost::checked_delete(p); // should cause compile time error + Incomplete ** pa; + boost::checked_array_delete(pa); // should cause compile time error + return 0; +} // main