| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  | //  Boost checked_delete test program  ---------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-08-10 10:34:20 +00:00
										 |  |  | //  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)
 | 
					
						
							| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-09-12 17:09:29 +00:00
										 |  |  | //  See http://www.boost.org/libs/utility for documentation.
 | 
					
						
							| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | //  Revision History
 | 
					
						
							|  |  |  | //  21 May 01  Initial version (Beman Dawes)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-02-17 06:20:57 +00:00
										 |  |  | #include <boost/checked_delete.hpp>  // for checked_delete
 | 
					
						
							| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | //  This program demonstrates compiler errors when trying to delete an
 | 
					
						
							|  |  |  | //  incomplete type.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     class Incomplete; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2003-07-16 10:53:06 +00:00
										 |  |  |     Incomplete * p = 0; | 
					
						
							| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  |     boost::checked_delete(p);          // should cause compile time error
 | 
					
						
							| 
									
										
										
										
											2003-07-16 10:53:06 +00:00
										 |  |  |     boost::checked_array_delete(p);    // should cause compile time error
 | 
					
						
							| 
									
										
										
										
											2001-05-22 18:58:21 +00:00
										 |  |  |     return 0; | 
					
						
							|  |  |  | }   // main
 |