mirror of
https://github.com/boostorg/core.git
synced 2025-11-28 21:30:09 +01:00
Add more checked_delete tests, a visit_each test.
This commit is contained in:
27
test/checked_delete_fail2.cpp
Normal file
27
test/checked_delete_fail2.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
// Boost checked_delete test program ---------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2001. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/utility for documentation.
|
||||
|
||||
// Revision History
|
||||
// 21 May 01 Initial version (Beman Dawes)
|
||||
|
||||
#include <boost/checked_delete.hpp> // for checked_delete
|
||||
|
||||
// This program demonstrates compiler errors when trying to delete an
|
||||
// incomplete type.
|
||||
|
||||
namespace
|
||||
{
|
||||
class Incomplete;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Incomplete * p = 0;
|
||||
boost::checked_array_delete(p); // should cause compile time error
|
||||
return 0;
|
||||
} // main
|
||||
Reference in New Issue
Block a user