checked_delete_fail2.cpp 727 B

123456789101112131415161718192021222324252627
  1. // Boost checked_delete test program ---------------------------------------//
  2. // Copyright Beman Dawes 2001. Distributed under the Boost
  3. // Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/utility for documentation.
  6. // Revision History
  7. // 21 May 01 Initial version (Beman Dawes)
  8. #include <boost/checked_delete.hpp> // for checked_delete
  9. // This program demonstrates compiler errors when trying to delete an
  10. // incomplete type.
  11. namespace
  12. {
  13. class Incomplete;
  14. }
  15. int main()
  16. {
  17. Incomplete * p = 0;
  18. boost::checked_array_delete(p); // should cause compile time error
  19. return 0;
  20. } // main