www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Exceptions part 2: Incomplete objects

reply Sean Kelly <sean f4.ca> writes:
# /*
#  This example demonstrates that the dtors of incomplete
#  objects are called during a GC run.
#  */
#  
#  import std.c.stdio;
#  import std.gc;
# 
# class IC
# {
#     this()
#     {
#         printf( "IC ctor\n" );
#         throw new Exception( "IC Exception" );    
#     }
#     
#     ~this()
#     {
#         printf( "IC dtor\n" );    
#     }
# }
# 
# void main()
# {    
#     try
#     {   
#         IC ic = new IC();
#         printf( "success\n" );
#     }
#     catch( Exception e )
#     {
#         printf( "fail: %.*s\n", e.toString() );    
#     }
#     fullCollect();
#     printf( "done\n" );
# }
Apr 13 2005
parent Sean Kelly <sean f4.ca> writes:
Oops, wrong forum.  I hit "back" one too many times.


Sean
Apr 13 2005